How does changing the IP address affect open sockets?


I’m updating an implementation of sockets for the W5500 and W5100 chips. Currently when socket.bind() is called it updates the IP address in SIPR0 - SIPR3 in the common register block. How will this affect other, open sockets?


According to the W5100 datasheet (chapter 5.1) setting SIPR is a part of the chip initialization procedure. Designers, most probably, did not assume and consider that SIPR will be changed on the fly. And we are left with guesses: if sockets do not have copy of the SIPR, then open sockets will have new packets flying using new IP address, if they have the copy then probably communication will complete properly until socket is closed.

Thanks Eugeny. I’ll force bind to use the initial IP address and not the IP address it’s called with.