admin管理员组文章数量:1130349
How to release the port of TCP Client immediately when the connection is disconnect with the TCP server. - TCP 客户端与 TCP 服务器断开连接后,如何立刻释放端口
在 TCP C/S 模式下,当 TCP 客户端想断开的时候,不能用 shutdown 和 closesocket 与 TCP 服务器断开,只有让 TCP 服务器端主动断开(TCP 客户端被动断开),TCP 客户端的端口才能立刻被释放。
举个例子:
如果 TCP Client 要想与 TCP Server 断开 TCP 连接,TCP Client 可以向 TCP Server 发一个 “Quit” 字符串命令,
TCP Server 检测到 TCP Client 发送了 “Quit” 字符串,就 closesocket
TCP Client 侧的 socket 也会触发断开,这样 TCP Client 端口就可以立刻被释放
How to release the port of TCP Client immediately when the connection is disconnect with the TCP server. - TCP 客户端与 TCP 服务器断开连接后,如何立刻释放端口
在 TCP C/S 模式下,当 TCP 客户端想断开的时候,不能用 shutdown 和 closesocket 与 TCP 服务器断开,只有让 TCP 服务器端主动断开(TCP 客户端被动断开),TCP 客户端的端口才能立刻被释放。
举个例子:
如果 TCP Client 要想与 TCP Server 断开 TCP 连接,TCP Client 可以向 TCP Server 发一个 “Quit” 字符串命令,
TCP Server 检测到 TCP Client 发送了 “Quit” 字符串,就 closesocket
TCP Client 侧的 socket 也会触发断开,这样 TCP Client 端口就可以立刻被释放
版权声明:本文标题:How to release the port of TCP Client immediately when the connection is disconnect with the TCP server. - TCP 客户端与 TCP 服务器断开连接后 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/jiaocheng/1754580637a2704002.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论