-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added the interface IWebSocket for easier mock up
- Loading branch information
1 parent
904d5e9
commit 8bbb61b
Showing
2 changed files
with
25 additions
and
7 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,23 @@ | ||
using System; | ||
using System.Buffers; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using SuperSocket.WebSocket; | ||
|
||
namespace WebSocket4Net | ||
{ | ||
public interface IWebSocket | ||
{ | ||
ValueTask<bool> OpenAsync(CancellationToken cancellationToken = default); | ||
|
||
ValueTask<WebSocketPackage> ReceiveAsync(); | ||
|
||
ValueTask SendAsync(string message); | ||
|
||
ValueTask SendAsync(ReadOnlyMemory<byte> data); | ||
|
||
ValueTask SendAsync(ref ReadOnlySequence<byte> sequence); | ||
|
||
ValueTask CloseAsync(CloseReason closeReason, string message = null); | ||
} | ||
} |
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