TCP connection problem


Vakul Garg <vakul.garg@...>
 

Hi

 

In my application running under zephyr, I open multiple TCP POSIX sockets and connect them with a TCP server on linux host.

The first client socket connects with TCP server gracefully. The second client socket chooses the same local port as the first one.

This causes the TCP connection for second client socket to fail.

 

On executing ‘conn’ command on zephyr shell, it reveal that the two of the connections use same local & remote port.

It seems that the connect() call is not choosing a free port for the socket.

 

Regards

 

Vakul

net> conn

     Context    Iface         Flags Local               Remote

[ 1] 0x0040c200 0x004051a0    4ST   0.0.0.0:9238        0.0.0.0:0

[ 2] 0x0040c258 0x004051a0    4ST   192.0.2.1:9238      192.0.2.2:52589

[ 3] 0x0040c2b0 0x004051a0    4DU   0.0.0.0:4433        192.0.2.1:4434

[ 4] 0x0040c308 0x004051a0    4ST   0.0.0.0:16384       192.0.2.2:9239

[ 5] 0x0040c360 0x004051a0    4ST   192.0.2.1:9238      192.0.2.2:52590

[ 6] 0x0040c3b8 0x004051a0    4DU   0.0.0.0:4434        192.0.2.1:4433

[ 7] 0x0040c410 0x004051a0    4ST   0.0.0.0:16384       192.0.2.2:9239

 

TCP        Src port  Dst port   Send-Seq   Send-Ack  MSS    State

0x0040dba0     9238     52589 1234687429 1974441142  1460   ESTABLISHED

0x0040dc60     9238     52590 2778482509  379001672  1460   ESTABLISHED

0x0040dd20    16384      9239 1326661533 1311733184  1460   ESTABLISHED

0x0040dde0     9238         0 2778482508  379001612  1460   LISTEN

0x0040dea0    16384      9239 2832855501          0  1460   SYN_SENT

Join users@lists.zephyrproject.org to automatically receive all group messages.