本文介绍了是否可以同时监听套接字连接并使用不同的端口发送数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为标题。我正在开发一个服务器端程序来通过端口X监听传入的套接字连接,并通过端口Y发送数据。我可能通过端口X从机器A收到一个字符串,并且必须将处理结果发送到机器B(或返回到机器)在某些情况下)通过端口Y.

我感到难过,因为我发现在Windows服务程序中很难做到。我可以成功收听,但有时无法发送数据,即使目标机器上的端口Y正在打开。我怎么能解决它?

As title. I am developing a server-side program to listen for incoming socket connections via Port X, and send data via Port Y. I may receive a string from machine A via port X, and must send processed result to machine B (or back to machine A in some case) via port Y.
I felt sad because I found it was hard to do in a windows service program. I can listen successfully but sometimes failed to send data out, even the port Y at the target machine is opening. How could I solve it?

推荐答案


这篇关于是否可以同时监听套接字连接并使用不同的端口发送数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 13:17
查看更多