コード例 #1
0
ファイル: FormMain.cs プロジェクト: Spectere/Spire
 void _connection_OnDataReceived(object sender, ServerData receivedData)
 {
     Log(string.Format("client <= server: {0} bytes received", receivedData.BytesRead));
     Log(receivedData.ToString());
 }
コード例 #2
0
ファイル: IrcConnection.cs プロジェクト: Spectere/Spire
 /// <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();
     }
 }