Sending byte array with length (and possible offset)
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- csharp
- Domain
- networking
Research direction
Start by locating the Send and Broadcast methods that currently accept byte[] and inspect their related call paths. Determine how a length, and possibly an offset, should be represented consistently across those methods. Done means callers can send the used portion of an existing buffer without copying it, with behavior covered by the repository’s relevant existing tests.
Written by the indexing model from the issue text.
Description
The Send & Broadcast methods support a byte[] argument. Would it be possible to also provide an override that takes a length argument. At the moment I receive a large amount of data into a byte array buffer, and then have to copy it into a know sized array for the Send/Broadcast methods. This is expensive to perform frequently e.g.
int read = ips.Read(data, 0, 64 * 1024);
Console.WriteLine($"Processing {read} bytes");
if (read > 0)
{
byte[] broadcast = new byte[read];
Buffer.BlockCopy(data, 0, broadcast, 0, read); // <--- Have to block copy my array
socketServer.WebSocketServices["/1"].Sessions.Broadcast(broadcast);
}
- 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