Ability to determine if a message is binary or text
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 28/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- csharp
- Domain
- networking
Research direction
Start by locating the OnMessage(byte[] bytes) API and the library's WebSocketMessageType handling across its supported clients. Review the two proposed API shapes and existing client behavior before choosing an approach; done means clients can reliably distinguish text messages from binary messages.
Written by the indexing model from the issue text.
Description
Currently, the API only has OnMessage(byte[] bytes), but this doesn't allow us to determine if the message was encoded as binary or text. This data is known to the library via WebSocketMessageType, so I suggest this be exposed to clients as well.
Some options:
- Add a second parameter, like:
OnMessage(byte[] bytes, WebSocketMessageType messageType) - Create separate events, like:
OnMessageText(string data)andOnMessageBinary(byte[] bytes).
I'd be happy to submit a PR implementing either approach, let me know what you think!
Thanks again for this great library.
- Dominant language
- C#
- Stars
- 1.7k
- Forks
- 206
- 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 endel/NativeWebSocket
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
endel/NativeWebSocket#107 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
endel/NativeWebSocket#102 · 1 comment · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
endel/NativeWebSocket#101 · 6 comments · 2 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
endel/NativeWebSocket#95 · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
endel/NativeWebSocket#94 · 2 comments ·
All issues in endel/NativeWebSocket
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
nightscout/nocturne#1425 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
RayWangQvQ/BiliBiliToolPro#1137 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100