ARMmbed / sockets

mbed sockets library abstraction layer
Other
6 stars 18 forks source link

TCPStream::connect() does not return an error when there are no connections free #34

Open bremoran opened 8 years ago

bremoran commented 8 years ago

When allocating a TCP protocol control buffer fails, TCPStream::connect() and TCPStream::open() should return an error code.

ciarmcom commented 8 years ago

ARM Internal Ref: IOTSFW-1092

bremoran commented 8 years ago

The sockets layer and the LwIP adaptor forward failure codes correctly. The problem here is that LwIP's behaviour on allocation of a TCP Protocol Control Block is to kill off a previous control block if the current control block is of higher priority. By default, LwIP sets all TCP PCBs to the same priority, so this seems to allow LwIP to kill off an existing connection in order to allocate the current one.

Since this is LwIP internal behaviour, it is not viable to fix this issue.