Created
August 11, 2017 18:18
-
-
Save jakesays-old/c0a50c811d252fc8e8ccb00e52114a7c to your computer and use it in GitHub Desktop.
Connection abstraction lifted from WCF
This file contains hidden or 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
using System; | |
using System.Diagnostics; | |
using System.Net; | |
using System.Threading; | |
using Std.Net.Support; | |
namespace Std.Net | |
{ | |
public interface IConnection | |
{ | |
byte[] AsyncReadBuffer { get; } | |
int AsyncReadBufferSize { get; } | |
TraceEventType ExceptionEventType { get; set; } | |
IPEndPoint RemoteIPEndPoint { get; } | |
void Abort(); | |
void Close(TimeSpan timeout, bool asyncAndLinger); | |
void Shutdown(TimeSpan timeout); | |
AsyncCompletionResult BeginWrite(byte[] buffer, | |
int offset, | |
int size, | |
bool immediate, | |
TimeSpan timeout, | |
WaitCallback callback, | |
object state); | |
void EndWrite(); | |
void Write(byte[] buffer, int offset, int size, bool immediate, TimeSpan timeout); | |
void Write(byte[] buffer, int offset, int size, bool immediate, TimeSpan timeout, BufferManager bufferManager); | |
int Read(byte[] buffer, int offset, int size, TimeSpan timeout); | |
AsyncCompletionResult BeginRead(int offset, int size, TimeSpan timeout, WaitCallback callback, object state); | |
int EndRead(); | |
// very ugly listener stuff | |
object DuplicateAndClose(int targetProcessId); | |
object GetCoreTransport(); | |
IAsyncResult BeginValidate(Uri uri, AsyncCallback callback, object state); | |
bool EndValidate(IAsyncResult result); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment