public void ReceiveMessage(Socket sourceSocket, Action<string> messageReceivedCallback) { ReceiveState receiveState = new ReceiveState() { SourceSocket = sourceSocket, MessageReceivedCallback = messageReceivedCallback }; this.ReceiveInternal(receiveState, 4); }
private void ReceiveInternal(ReceiveState receiveState, int size) { receiveState.SourceSocket.BeginReceive(receiveState.Buffer, 0, size, 0, this.ReceiveCallback, receiveState); }