sta / sta/websocket-sharp

Apparent problem with asynchronous + synchronous reads

Open
#96 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
6.1k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

I'm working on a Unity game, and we've discovered that in some situations, EndRead (in WebSocketFrame) is not called for some data that is ready on the wire. I logged an issue with Microsoft here: https://connect.microsoft.com/VisualStudio/feedback/details/1074045/using-beginread-under-the-unity-editor-will-prevent-the-async-callbacks-from-being-invoked

Their answer, which I'm still trying to understand precisely, is that doing synchronous reads from an asynchronous callback will cause problems. It's possible that the example project I gave them isn't a good representation of what websocket-sharp does (I simplified it greatly to try to demonstrate the problem). But there's definitely an issue, either in Unity/Mono/.NET or websocket-sharp.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing WebSocketFrame.EndRead and its BeginRead callbacks, then reproduce the reported case in Unity using the example project mentioned in the issue. Compare the behavior when synchronous reads occur inside asynchronous callbacks; done means determining whether the missing EndRead calls originate in websocket-sharp or Unity/Mono/.NET.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, unity
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.