forked from FireflyServer/firefly
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding a SocketSender buffering layer
Seperating the concern of buffering data and switching between immediate and async sending modes
- Loading branch information
Showing
22 changed files
with
894 additions
and
190 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
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
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 |
---|---|---|
@@ -1,23 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Net.Sockets; | ||
|
||
namespace Firefly.Utils | ||
{ | ||
public interface ISocket | ||
{ | ||
bool Blocking { get; set; } | ||
bool NoDelay { get; set; } | ||
bool Connected { get; } | ||
|
||
int Receive(byte[] buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode); | ||
bool ReceiveAsync(SocketAsyncEventArgs e); | ||
|
||
int Send(byte[] buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode); | ||
int Send(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode); | ||
bool SendAsync(SocketAsyncEventArgs e); | ||
|
||
void WaitToSend(); | ||
|
||
void Shutdown(SocketShutdown how); | ||
bool DisconnectAsync(SocketAsyncEventArgs e); | ||
void Close(); | ||
} | ||
|
||
} |
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.