c - Assigning static/same IP address to the Server everytime it logs in -


i working on udp server/client applicataion. since communicating server, clients must know ip address , port number of server. purpose, have hard coded ip , port number of server clients everytime, client connects same ip , port number. (found ip address of server machine using ipconfig command.) now, problem working on dhcp network, , there chance everytime sever machine restarted, new ip address may assigned (different ip address known clients @ connect.) so, want ip address hard coded @ client side assigned server machine, everytime logs in. there way it? have no idea it. searched internet couldn't find relevant. looking forward :(

assuming clients local server, why not abandon hard-coded server ip address, , borrow page dhcp , use kind of service discovery method:

  • your clients broadcast "where server" message when first come online. server responds "i @ ip address x.x.x.x"
  • when server comes up, broadcasts "server @ ip address y.y.y.y" if server crashed, clients start using new server.

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -