sta / sta/websocket-sharp

e.Data (MessageEventArgs.Data) as a public static string?

Open
#509 2 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

Hello all,

Trying to copy data received from one websocket connection to another websocket session. I was thinking to use a public static variable for this purpose

public static MessageEventArgs.Data copy data;
public class Input : WebSocketBehavior
{
protected override void OnMessage(MessageEventArgs e)
{
data = e.data;
}
}
public class AllCommunication : WebSocketBehavior
{
protected override void OnMessage(MessageEventArgs e)
{
Sessions.Broadcast(data);
}
}

Basically I want to take everything from one input and rebroadcast it to many users connected on a different session.

Thanks for any ideas or suggestions!

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

Review how Input receives MessageEventArgs.Data and how AllCommunication uses Sessions.Broadcast. Determine whether the project provides a supported way to relay messages from one WebSocket connection to sessions on another; done would be a clearly defined, working rebroadcast approach.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.