コード例 #1
0
ファイル: SocketClient.cs プロジェクト: melo/sapo-broker
 private void WaitForMessageBody(BrokerPacket messagePacket, int messageLenght)
 {
     try
     {
         messagePacket.msgBodyHolder = new byte[messageLenght];
         // Start listening to the data asynchronously
         _pendingAsyncResult = _clientSocket.BeginReceive(
             messagePacket.msgBodyHolder, 0, messageLenght, SocketFlags.None,
             new AsyncCallback(OnMessageBodyReceived), messagePacket);
     }
     catch (Exception ex)
     {
         _bkClient.ExceptionCaught(ex);
     }
 }
コード例 #2
0
ファイル: SocketClient.cs プロジェクト: melo/sapo-broker
 private void AcumulateMessageHeader(BrokerPacket messagePacket, int messageLenght, int offset)
 {
     messagePacket.thisSocket = _clientSocket;
     // Start listening to the data asynchronously
     _pendingAsyncResult = _clientSocket.BeginReceive(messagePacket.msgLengthHolder, offset,
         messageLenght, SocketFlags.None, new AsyncCallback(OnHeaderReceived), messagePacket);
 }
コード例 #3
0
ファイル: SocketClient.cs プロジェクト: melo/sapo-broker
 private void WaitForHeader()
 {
     if (_isDisposed)
     {
         return;
     }
     try
     {
         BrokerPacket messagePacket = new BrokerPacket();
         messagePacket.thisSocket = _clientSocket;
         // Start listening to the data asynchronously
         _pendingAsyncResult = _clientSocket.BeginReceive(messagePacket.msgLengthHolder, 0,
             messagePacket.msgLengthHolder.Length, SocketFlags.None,
             new AsyncCallback(OnHeaderReceived), messagePacket);
     }
     catch (Exception ex)
     {
         _bkClient.ExceptionCaught(ex);
     }
 }
コード例 #4
0
ファイル: SocketClient.cs プロジェクト: melo/sapo-broker
 private void AcumulateMessageBody(BrokerPacket messagePacket, int messageLenght, int offset)
 {
     _pendingAsyncResult = _clientSocket.BeginReceive(
         messagePacket.msgBodyHolder, offset, messageLenght, SocketFlags.None,
         new AsyncCallback(OnMessageBodyReceived), messagePacket);
 }