Only receiving the first character of incoming messages
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- csharp
- Domain
- networking
Research direction
Reproduce the issue with the Laputa code sample from the README under Mono 4.4, using WebSocketServer and the OnMessage handler as the entry points. Trace incoming message delivery and verify that sending “BALUS” produces the complete value in e.Data rather than only “B”; the issue is done when the sample responds correctly.
Written by the indexing model from the issue text.
Description
This is bizarre. I've installed via nuget, and then I cloned and built from source. I'm running on mono 4.4. I can reproduce the behavior with the Laputa code sample from the README. Opening the socket works fine. But when I try and actually send any data, I only receive the first character. So, here is (slightly modified) laputa sample I'm working against:
using System;
using WebSocketSharp;
using WebSocketSharp.Server;
namespace Example
{
public class Laputa : WebSocketBehavior
{
protected override void OnMessage(MessageEventArgs e)
{
var msg = e.Data == "BALUS"
? "I've been balused already..."
: "I'm not available now.";
Send(msg);
}
}
public class Program
{
public static void Main(string[] args)
{
var wssv = new WebSocketServer("ws://localhost:8003");
wssv.AddWebSocketService<Laputa>("/Laputa");
wssv.Start();
while(true) {
System.Threading.Thread.Sleep (1000);
}
//Console.ReadKey(true);
wssv.Stop();
}
}
}
If I put a breakpoint in the OnMessage handler, e.Data is always just the first character. So if I send 'BALUS' as my message, I only get 'B' in e.Data, so the example fails to load.
Any ideas?
- 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
- 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.
More from sta/websocket-sharp
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
sta/websocket-sharp#201 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 45/100
sta/websocket-sharp#762 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
sta/websocket-sharp#761 ·
-
Bad handling of sending stream makes lib not RFC compatible and KeepClean useless in some cases. Open
Difficulty 4/5 3-5 days Newbie friendliness 42/100
sta/websocket-sharp#760 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
sta/websocket-sharp#759 ·
All issues in sta/websocket-sharp
Similar issues
-
bug documentation frontend
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
azurenoops/spin_agent#975 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100