vb.net - 客户端断开连接时从 TCP/IP 服务器引发的错误
问题描述
我将以下代码作为 TCP/IP 服务器的一部分。该程序运行良好,但我注意到 System.IO.IOException 错误Server
作为Client
断开连接抛出。(我实际上是在断开客户端的连接。)
Private Sub ReadAllClient()
Try
RaiseEvent getMessage(New StreamReader(listClient.GetStream).ReadLine)
listClient.GetStream.BeginRead(New Byte() {0}, 0, 0, New AsyncCallback(AddressOf ReadAllClient), Nothing)
Catch ex As Exception
RaiseEvent clientLogout(Me)
End Try
End Sub
(编辑:错误消息详细信息)
System.IO.IOException: 'Unable to read data from the transport
connection: An established connection was aborted by the software in
your host machine.'
此错误通常不是 VS 2017 的一部分,只是将其抛出以查找原因,它就是这个 Try/Catch 语句。(Catch 部分肯定在工作......但正在抛出错误。)
我应该担心这个异常被抛出吗?或者它是否足够安全而可以忽略?
解决方案
推荐阅读
- python - Python CSV 重新索引
- phaser-framework - 当我移动相机时,多边形从画布上消失
- asp.net-mvc-5 - 嵌套类属性过滤器不起作用 MVC5 NonFactor Grid
- linux - 为非 root 用户创建工作 Docker 映像的问题
- java - 尽管我使用约束布局,但布局在不同的设备上发生了变化
- apache - 根据认证数据重写目录路径
- icecast - 如何验证 listclients 请求
- html - 如何将标签跨度和输入放在同一行
- docker - “Docker 子网”是做什么用的?
- c++ - 找不到错误的来源:'Undefined symbols for architecture x86_64' Makefile