allow multithreaded / non queued onMessage

Open
#595 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp
Domain
networking

Research direction

Start by tracing the onMessage handling path in websocket-sharp and compare the behavior described in linked issue #342. Determine whether received messages can be dispatched without queueing while preserving the library's documented guarantees. Done means rapid messages no longer accumulate processing lag, with ordering behavior and concurrency expectations documented or covered by tests.

Written by the indexing model from the issue text.

Description

It seems onMessage is queued and so with rapid updates, it turns to an ever increasing lag. For example, user A runs around (in Unity) and emits updates about 6 times a second. These messages are sent to the server and then back to the other players in the multiplayer game. User B receives the 6 updates that second but processes them serially and it takes awhile, getting backed up. Over the course of just 15 seconds, user B is already over 5 seconds behind, making the game unplayable. How do I receive onMessage calls immediately when they are received? I understand that may mean I will not get them in a deterministic order; that's okay I'll handle that. I just need updates immediately.

This issue seems to be mentioned in several other places but I haven't seen a resolution.

https://github.com/sta/websocket-sharp/issues/342
https://www.reddit.com/r/csharp/comments/8i5zo9/any_websocketsharp_experience/

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

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.

More from sta/websocket-sharp

All issues in sta/websocket-sharp

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.