RTCS

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
644 Views
netra
Contributor IV

How the server will know the client(windows) has shutdown the socket ??

Please reply

0 Kudos
1 Solution
380 Views
butok
NXP Employee
NXP Employee

For UDP server, it should be handled by an application protocol.

For TCP server, the connection is closed automatically, in case of connection graceful shutdown or reset.

If client was physically unplugged and no shutdown was detected by the server, the TCP keep-alive mechanism is used => the connection will be closed in some timeout.

Any manipulations (recv(), send() etc.) with a TCP socket that has closed connection will cause error.

Best regards,

Andrey Butok

View solution in original post

0 Kudos
1 Reply
381 Views
butok
NXP Employee
NXP Employee

For UDP server, it should be handled by an application protocol.

For TCP server, the connection is closed automatically, in case of connection graceful shutdown or reset.

If client was physically unplugged and no shutdown was detected by the server, the TCP keep-alive mechanism is used => the connection will be closed in some timeout.

Any manipulations (recv(), send() etc.) with a TCP socket that has closed connection will cause error.

Best regards,

Andrey Butok

0 Kudos