TCP端点的动态发现
问题描述:
如果我使用TcpListener公开和TCP端点,我如何动态发现网络上特定类型的所有开放侦听器?希望它能让我的用户轻松连接(类似于发现SQL服务器实例)。
If I expose and TCP endpoint using TcpListener, how can I dynamically discover all the open listeners of a specific type on my network? Want it make it easy to connect for my users (similar to discovering SQL server instances).
谢谢,¥b $ b David
Thanks,
David
答
嗨David。
Hi David.
我不认为使用tcp是可行的需要知道你连接的端点。
I don't think it's possible using tcp as you need to know the endpoint you're connectiong to.
我会使用UDP,这样你就可以用你的tcp端点信息广播一条消息,然后客户端可以用它打开一个tcp连接。
I would use UDP so you can broadcast a message with your tcp endpoint informations and clients could then open a tcp connection using that.
请参阅"使用UDP服务"
Alexandre
Alexandre