停止TcpListener

编程入门 行业动态 更新时间:2024-10-26 02:36:53
本文介绍了停止TcpListener的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我创建了TcpListener。 socket = listener.AcceptSocket(); socket.SetSocketOption(SocketOptionLevel.Socket,SocketOptionName.ReuseAddress,false); 当收到任何消息时,它的工作正常。 但是首先启动监听器,我突然想要停止监听器抛出错误。 "通过调用WSACancelBlockingCall来中断阻塞操作" 如何无误地阻止监听器。 提前致谢 Kalees

解决方案

你很久以前就有同样的问题了。看看我的这个帖子。 social.msdn.microsoft/Forums/en-US/netfxnetcom/thread/7ffeef71-8978-41c9-9787-6d74e1326700 ETS

Hi , I created TcpListener. socket = listener.AcceptSocket(); socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, false); Its working fine when any messages received. But first start the Listener , suddenly i want stop the listener its throwing the error. "A blocking operation was interrupted by a call to WSACancelBlockingCall" How to stop the listener without error. Thanks in Advance Kalees

解决方案

Hii had the same issue not so long ago. have a look at this thread of mine.social.msdn.microsoft/Forums/en-US/netfxnetcom/thread/7ffeef71-8978-41c9-9787-6d74e1326700Ets

更多推荐

停止TcpListener

本文发布于:2023-11-12 18:46:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1582247.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:TcpListener

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!