-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use RecyclableMemoryStream instead of MemoryStream (#133)
* Use RecyclableMemoryStream instead of MemoryStream * Add SendTextAsBinary method * Remove NETSTANDARD2_0 pragma conditions
- Loading branch information
Showing
5 changed files
with
212 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System; | ||
|
||
namespace Websocket.Client | ||
{ | ||
internal abstract class RequestMessage { } | ||
|
||
internal class RequestTextMessage : RequestMessage | ||
{ | ||
public string Text { get; } | ||
|
||
public RequestTextMessage(string text) | ||
{ | ||
Text = text; | ||
} | ||
} | ||
|
||
internal class RequestBinaryMessage : RequestMessage | ||
{ | ||
public byte[] Data { get; } | ||
|
||
public RequestBinaryMessage(byte[] data) | ||
{ | ||
Data = data; | ||
} | ||
} | ||
|
||
internal class RequestBinarySegmentMessage : RequestMessage | ||
{ | ||
public ArraySegment<byte> Data { get; } | ||
|
||
public RequestBinarySegmentMessage(ArraySegment<byte> data) | ||
{ | ||
Data = data; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.