|
|
Re: Network disconnect/reconnect notification
|
|
03/25/2010 2:57 PM
post50483
|
Re: Network disconnect/reconnect notification
On 25/03/10 02:54 PM, Jared Roundy wrote:
> 1) We are writing an application that would like to be notified when the network cable is disconnected or reconnected
(or link is lost/established). Is there a way to get this notification?
>
> 2) Is there any way to get notification of when the IP address on an interface is assigned or changed?
>
> 3) We are also wondering what kind of code we need in our network applications to handle the case where the interface
IP address is changed? Either because we get a new DHCP address, or the network cable is unplugged from one network and
plugged into another. If we don't need any code is there any explanation of what messages we get from the socket layer
in such a case.
>
You can use a routing socket. You can see code examples in 'route
monitor' command or 'if_up'.
HTH,
/P
|
|
|
|
|