Applications using a DHCP configured interface

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Applications using a DHCP configured interface

Jump to solution
1,802 Views
w2vy
Contributor V

If I have server applications running that are listening

 

// Start Server srvr = socket(PF_INET, SOCK_STREAM, 0); /* Bind the socket to the port */ any.sin_family      = AF_INET; any.sin_port        = 80; any.sin_addr.s_addr = INADDR_ANY; bind(srvr, &any, sizeof(any)); listen(srvr, 0);

 

Will this server continue to run properly if the interface is moved from one LAN to another and the IP address assigned by DHCP changes?

 

What is the right way to re-activate DHCP when the cable is re-interted?

 

tom

Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
890 Views
w2vy
Contributor V

FYI I ended up polling the link state with

ipcfg_get_link_active(IPCFG_default_enet_device)

 

and when the link went away, I would unbind the old IP and reenable DHCP to get the new IP

 

tom

View solution in original post

0 Kudos
Reply
1 Reply
891 Views
w2vy
Contributor V

FYI I ended up polling the link state with

ipcfg_get_link_active(IPCFG_default_enet_device)

 

and when the link went away, I would unbind the old IP and reenable DHCP to get the new IP

 

tom

0 Kudos
Reply