Applications using a DHCP configured interface

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Applications using a DHCP configured interface

跳至解决方案
2,213 次查看
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

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,301 次查看
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 项奖励
回复
1 回复
1,302 次查看
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 项奖励
回复