UDP 套接字未与端口解除绑定
我面临一个奇怪的问题,当我调用 closesocket() 时,之前绑定到端口的 UDP 套接字并未从该端口解除绑定。 API 调用不会返回任何错误,但 netstat 命令和 TCPView 应用程序仍然显示该端口仍在被我的应用程序使用。
我的应用程序是一个 COM 服务器,套接字创建发生在一个线程上,绑定关闭发生在不同线程上,在第三个线程上读取。
到目前为止,尝试在同一线程上创建套接字、绑定、读取和关闭,但仍然遇到问题。
I am facing a strange issue where my UDP socket that was earlier bound to a port is not unbinding from the port when I call closesocket(). The API call doesn't return any error but netstat command and TCPView app still show that port is still in use by my application.
My application is a COM server and socket creation happens on one thread, binding closing happens on different thread, reading on a third thread.
So far tried creating the socket, binding, reading and closing on the same thread but still seeing the issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论