同时监听不同的端口 [英] Listening different ports at the same time

查看:72
本文介绍了同时监听不同的端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,

如何同时从服务器监听多个端口?

从现在开始谢谢您.

Hello friends,

How can I listen multiple ports from a server at the same time?

Thank you from now on.

推荐答案

您可以通过为每个端口创建单独的线程,然后侦听和处理该线程上的数据来做到这一点.
您还可以为每个端口创建和运行单独的进程,或者使用不同的命令行运行同一程序.
You can do so by creating separate threads for each port, and listening and processing the data on that thread.

You can also create and run separate processes for each port, or run the same program with different command lines.


阅读此线程,可能对您有所帮助
http://stackoverflow.com/questions/7699794/how-to-在同一时间读取多个tcpports [ ^ ]
Read this thread, might help you
http://stackoverflow.com/questions/7699794/how-to-read-multiple-tcpports-at-same-time[^]


这篇关于同时监听不同的端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆