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 摘要。