RTCSERR_SOCK_ESHUTDOWN from select()

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RTCSERR_SOCK_ESHUTDOWN from select()

709 Views
emanueletrapani
Contributor III

Hi, i use MQX 4.2, CW 10.6 and frdmk64f.

in my application, i stay in select() function waiting activity on the socket. i created this stream socket and i connect it to a remote server that is always running. sometimes the select() function return a error unexpected: 0x1719. it is unexpected because the server is always running and it not send any closing request. the freedom board is connected on a router that is connected on the network where the server stay.

i read the documentation of RTCS. In the chapter of select() function i see that it is explained that this error is returned from select() when happens "Abort request (remote host sends RST or unexpected SYN to us)".

My question is: what is the cause of this error? what means "unexpected SYN to us"?

0 Kudos
Reply
1 Reply

551 Views
Martin_
NXP Employee
NXP Employee

When you get this error code it means the stack has already closed the TCB (whatever reason). Most typical is RST received from connected peer, but it can also be a received SYN when a connection is already established.

As the TCB does not exists, your software has to closesocket(). It can also open a new connection to the server.