[英]Can I create a socket server in C# that has a dynamic IP?
As far as I know for a socket client to be able to connect to a socket server it needs to know the server's IP address. 据我所知,套接字客户端能够连接到套接字服务器,它需要知道服务器的IP地址。
But what happens when the server is using a dynamic IP address? 但是当服务器使用动态IP地址时会发生什么?
Is it possible to connect to the server in any other way (I don't think so) ? 是否有可能以任何其他方式连接到服务器 (我不这么认为) ?
Is there a way for me to let the client know the server's IP address automatically? 有没有办法让客户自动知道服务器的IP地址?
Thanks in advance 提前致谢
Is it possible to connect to the server in any other way (I don't think so)?
是否有可能以任何其他方式连接到服务器(我不这么认为)?
You could use a DNS name as well. 您也可以使用DNS名称。 There are some DNS providers which allow you to associate a fixed DNS name to a dynamic IP address.
有一些DNS提供程序允许您将固定DNS名称与动态IP地址相关联。 You may take a look at dyndns .
您可以看看dyndns 。
Is there a way for me to let the client know the server's IP address automatically?
有没有办法让客户自动知道服务器的IP地址?
The client needs an IP or DNS name. 客户端需要IP或DNS名称。
you may store the dynamic IPs in some static IP data storage. 您可以将动态IP存储在某些静态IP数据存储中。 the client will always know the static IP adress and from there he will take the dynamic adress.
客户端将始终知道静态IP地址,并从那里获取动态地址。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.