[BC660] lwip APIs

At the sockets.h file on the SDK for lwip there are some defines for the so_options of the sockets, and some of them are commented as unimplemented:

#define SO_OOBINLINE   0x0100 /* Unimplemented: leave received OOB data in line */
#define SO_REUSEPORT   0x0200 /* Unimplemented: allow local address & port reuse */
#define SO_SNDBUF      0x1001 /* Unimplemented: send buffer size */

For me, the most important information to take from this is if the SO_REUSEPORT won’t work at all?
I mean, If I open a socket on port 1111 (for example), close it, and try to open again on port 1111, it won’t work?

I did tests on this using the module as a Server Socket, and reusing the same port works fine.

But, I noticed on the other module (acting as a client), if I use the same source port, then it will fail to connect. In this case, I was using AT commands for the client side.

For example:

  • Server IP: X.Y.Z.A
  • Server Port: 55555

Client side:

AT+QIOPEN=0,1,"TCP",X.Y.Z.A,55555,7000,1

Then, client connects, I can exchange data and etc. Then I close the connection on the client side:

AT+QICLOSE=1

Then I try again to connect using the same source port 7000, and it will return error.
So, I have to change the source port to something else, for example, 7001, then it connects fine.