amnesia-spelos / amnesia-spelos/streamnesia

IOException when .NET client disconnects from a live server

未关闭
#50 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
C# low priority
主要语言
C#
星标
4
派生
3
PR 合并指标
30 天内没有已合并 PR

描述

## Summary

The .NET client is unable to disconnect from the game server gracefully. Upon disconnecting, the AmnesiaClient's `ReadLine` throws an `IOException` despite attempting to be cancelled using a `CancellationToken`.

This is not graceful, however, it doesn't affect the usability of the application and can be fixed ad-hoc.

## How to Reproduce

1. Open the game client
2. Open Streamnesia.WebApp
3. Connect to the game client
4. Go back to Streamnesia
5. Disconnect from the game client
6. Exception should be logged

## Exception Thrown

```log
fail: Streamnesia.Execution.AmnesiaClient[0]
Failed to read the next client line.
System.IO.IOException: Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request..
---> System.Net.Sockets.SocketException (995): The I/O operation has been aborted because of either a thread exit or an application request.
--- End of inner exception stack trace ---
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
at System.IO.StreamReader.ReadBufferAsync(CancellationToken cancellationToken)
at System.IO.StreamReader.ReadLineAsyncInternal(CancellationToken cancellationToken)
at Streamnesia.Execution.AmnesiaClient.ReadNextLineSafe(CancellationToken cancellationToken) in C:\Users\spelos\source\repos\spelos\streamnesia\src\Streamnesia.Execution\AmnesiaClient.cs:line 122
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。