简体   繁体   中英

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.

But what happens when the server is using a dynamic IP address?

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?

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. There are some DNS providers which allow you to associate a fixed DNS name to a dynamic IP address. You may take a look at dyndns .

Is there a way for me to let the client know the server's IP address automatically?

The client needs an IP or DNS name.

you may store the dynamic IPs in some static IP data storage. the client will always know the static IP adress and from there he will take the dynamic adress.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM