CloseEventArgs Reason text is not transferred correctly
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.1k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
I implement the server and the client with WebSocketSharp v1.0.4.0
In the server i use this code to close a connection:
Sessions.CloseSession(ID, CloseStatusCode.ProtocolError, "Request is missing the Target");
In the client, i have this code:
private void WsOnOnError(object sender, ErrorEventArgs errorEventArgs)
{
Console.WriteLine($"WsOnOnError {errorEventArgs.Message} {errorEventArgs.Exception}");
}
private void WsOnOnClose(object sender, CloseEventArgs closeEventArgs)
{
Console.WriteLine($"WsOnOnClose {closeEventArgs.Reason} {closeEventArgs.Code} {closeEventArgs.WasClean}");
}
My output is:
WsOnOnClose h♥?♦_§?QS§?∟S§?↑T☺?♣R♥?%[¶?¶N 1002 True
The reason is showing corrupted text.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue using Sessions.CloseSession with CloseStatusCode.ProtocolError and the client WsOnOnClose handler shown in the report. Trace how the close reason travels from the server to CloseEventArgs.Reason, and verify that the exact text "Request is missing the Target" is received instead of corrupted characters. Done means the reported reason is preserved while the close code remains 1002.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100