How to detect the change of interface address in the socket programming?



Dear all,

There is a socket programming issue as below. Please help to provide
your good idea for our reference. Thanks!

In our linux system, there are two network cards with two different IP
addresses (for example: 10.1.1.1 and 20.2.2.2). We write a server
program to bind a socket with one of above interfaces (10.1.1.1) for
receiving the requests from any client. After a period of operation,
the IP address of such interface would be chagned from 10.1.1.1 to
30.3.3.3. The original binding for socket would not identify such
change and fail to communicate with client. Is there any good solution
to detect the change of interface address and then re-bind the socket
to new IP address?

Best Regards,
Riker.
.



Relevant Pages

  • RE: socket communication: socket doesnt connect
    ... = overlapped using I/O Completion Port (IOCP) ... I am a complete beginner in socket programming and in using threads. ... Your server is written in C++. ...
    (microsoft.public.win32.programmer.networks)
  • Is socket.shutdown(1) useless
    ... Issues of socket programming can be wierd, ... In my python books I find exclusive use of socket.close. ... the client closes the socket ...
    (comp.lang.python)
  • Re: Socket relared problem (getting free port number dynamically)
    ... You appear to be doing raw socket programming, which isn't really a good idea most of the ... on some event create a thread for validation purpose and then will ... but in this way i need to stick with port 20111.which i really don't ...
    (microsoft.public.vc.mfc)
  • Re: How to detect the change of interface address in the socket programming?
    ... There is a socket programming issue as below. ... change and fail to communicate with client. ... to detect the change of interface address and then re-bind the socket ...
    (comp.os.linux.development.system)
  • Re: Beginning Sockets
    ... > guide to socket programming and thought it was brillient. ... Also, after you call bind, you need to call acceptto get a socket ... descriptor for the connection. ... Then you use the descriptor returned by ...
    (comp.unix.programmer)