Exemplo n.º 1
0
 void _connection_OnDataReceived(object sender, ServerData receivedData)
 {
     Log(string.Format("client <= server: {0} bytes received", receivedData.BytesRead));
     Log(receivedData.ToString());
 }
Exemplo n.º 2
0
 /// <summary>
 /// Indicates when data is ready to be received from the server.
 /// </summary>
 public void Receive()
 {
     while(Connected) {
         var data = new ServerData(RecieveBufferSize);
         _socket.BeginReceive(data.Buffer, 0, data.BufferSize, SocketFlags.None, ReceiveCallback, data);
         _receiveDone.WaitOne();
         _receiveDone.Reset();
     }
 }