RTCS

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决
1,177 次查看
netra
Contributor IV

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

Please reply

0 项奖励
回复
1 解答
913 次查看
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 项奖励
回复
1 回复
914 次查看
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 项奖励
回复