sta / sta/websocket-sharp

Receive message issue

Open
#287 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

Hi There,

I am trying to use websocket-sharp on my application, and I have an issue receive messages. Can anyone help me please?

Here is my code:
var receiveData=string.Empty();
var webSocket = new WebSocket(url);
webSocket.OnOpen += (sender, e) => { };
webSocket.OnMessage += (sender, e) => { };
webSocket.Connect();
webSocket.Send(message);
webSocket.OnMessage += (sender, e) =>
{
if (e.IsText && !e.IsPing)
{
receiveData = e.Data;
}
};
Console.WriteLine(receiveData); // receiveData always empty
webSocket.Close();

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

The issue names no repository file or test. Start with the provided WebSocket setup and determine whether the receive callback is reached before Console.WriteLine and Close; done would require a reproducible repository-level problem and a specified fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
networking
Issue type
Bug
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.