TcpListener和端口 [英] TcpListener and ports
本文介绍了TcpListener和端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
服务器程序可以有2个不同的TcpListner吗?
而2个TcpListner具有相同的IP但不同的端口
SAME程序的所有内容
可以用这种方式做到吗?
感谢
can the server program have 2 different TcpListner ?
while the 2 TcpListner have the same IP but different Port
all that for the SAME program
can make it in this way ?
thanks
推荐答案
是的,只要端口不同.
是的,因为每个tcp网络数据包都有IP,端口和协议标识符.
甚至还可以在同一端口上运行TcpListener和UdpListener.
但是您不能将两个类型(tcp或udp)的侦听器绑定到同一端口.
Yes, it is possible as every tcp network packet has an IP, Port and Protocol-Identifier.
It is even possible to run a TcpListener and an UdpListener on the same port, too.
But you cannot bind two listener of one type (tcp or udp) to the same port.
这篇关于TcpListener和端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文