public UdpSocketReceive(SocketStatus status, int count, UdpSocket socket, SocketBuffer buffer, byte[] address) { this.status = status; this.count = count; this.socket = socket; this.buffer = buffer; this.address = address; }
public UdpSocketSend(SocketStatus status, int count, UdpSocket socket, SocketBuffer buffer, IPEndPoint endpoint) { this.status = status; this.count = count; this.socket = socket; this.buffer = buffer; this.endpoint = endpoint; }
public void Receive(SocketBuffer buffer, TcpSocketReceiveCallback callback) { TcpSocketReceiveRoutine routine = new TcpSocketReceiveRoutine(handle, buffer); TcpSocketReceiveResult result = new TcpSocketReceiveResult { Socket = this, Buffer = buffer, OnReceived = callback }; routine.Execute(result); }
public void Send(SocketBuffer buffer, TcpSocketSendCallback callback) { TcpSocketSendRoutine routine = new TcpSocketSendRoutine(handle, buffer); TcpSocketSendResult result = new TcpSocketSendResult { Socket = this, Buffer = buffer, OnSent = callback }; routine.Execute(result); }
public void Send(IPEndPoint endpoint, SocketBuffer buffer, UdpSocketSendCallback callback) { UdpSocketSendRoutine routine = new UdpSocketSendRoutine(handle, endpoint, buffer); UdpSocketSendResult result = new UdpSocketSendResult { Socket = this, Buffer = buffer, OnSent = callback, Endpoint = endpoint }; routine.Execute(result); }
public Task <TcpSocketReceive> Receive(SocketBuffer buffer) { TcpSocketReceiveResult result = new TcpSocketReceiveResult { Socket = this, Buffer = buffer, Event = new ManualResetEvent(false) }; Task <TcpSocketReceive> task = Task.Factory.FromAsync(result, ar => ((TcpSocketReceiveResult)ar).CreateData()); TcpSocketReceiveRoutine routine = new TcpSocketReceiveRoutine(handle, buffer); routine.Execute(result); return(task); }
public Task <UdpSocketReceive> Receive(SocketBuffer buffer) { throw new NotImplementedException(); }
public Task <UdpSocketSend> Send(IPEndPoint endpoint, SocketBuffer buffer) { throw new NotImplementedException(); }
public UdpSocketReceiveRoutine(IntPtr handle, SocketBuffer buffer) { this.handle = handle; this.buffer = buffer; }
public TcpSocketSendRoutine(IntPtr handle, SocketBuffer buffer) { this.handle = handle; this.buffer = buffer; }
public UdpSocketSendRoutine(IntPtr handle, IPEndPoint endpoint, SocketBuffer buffer) { this.handle = handle; this.endpoint = endpoint; this.buffer = buffer; }