We have an application managing TCP socket that are created with socket() and listen(). As TCP sockets are created, we keep a list of the host and port info. When a socket is closed, we clear the host and port info from our list. When the ethernet port gets disconnected (link down), the host and port info may no longer be valid. Flushing our list based on an inactivity timer is not a good option. We would like to flush the list when we lose the ethernet link.
My question is: How can our application get notified when the ethernet link that our listen socket is bound to goes link down without having to poll the driver with a devctrl() call.
Many thanks in advance for any advice or relevant info.