可用的TCP侦听器列表 [英] List of Available TCP Listeners
本文介绍了可用的TCP侦听器列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用以下代码启动TCP侦听器
I hav used following code to start the TCP Listener
TcpListener serverSocket = new TcpListener(8888);
serverSocket.Start();
我使用以下代码在LAN中找到所有可用的听众
I hav used following code to find All Available Listeners in LAN
Console.WriteLine("Active TCP Listeners");
IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
IPEndPoint[] endPoints = properties.GetActiveTcpListeners();
foreach (IPEndPoint e in endPoints)
{
Console.WriteLine(e.ToString());
}
但TCP侦听器已经started..i可以将TCP侦听器与我的TCP客户端连接..
但是我无法使用 properties.GetActiveTcpListeners()方法找到活动的TCP侦听器IP .. < br $> b $ b
请帮助我..
先谢谢你..
But the TCP Listener has been started..i can connect the TCP listenrs with my TCP Client..
but i cannot find the active TCP Listeners IP by using properties.GetActiveTcpListeners() method..
Kindly help me on this..
Thanks in Advance..
推荐答案
你好Dinesh,
您写道: 我找不到活动的TCP侦听器IP使用properties.GetActiveTcpListeners()
如果我理解正确你试图得到听众的 IP ,是对的吗?
如果是这样,这没有意义,请参阅 -GetActiveTcpListerens
方法仅适用于本地计算机上的侦听器 。
干杯,
Edo
Hi Dinesh,
You wrote: "i cannot find the active TCP Listeners IP by using properties.GetActiveTcpListeners()"
If I understand correctly you tried to get the IP of the listener, is that right?
If so, this does not make sense, see - theGetActiveTcpListerens
method only works for listeners on the local computer.
Cheers,
Edo
这篇关于可用的TCP侦听器列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文