Example #1
0
 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);
     }
 }
Example #2
0
 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);
 }
Example #3
0
 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);
     }
 }
Example #4
0
 private void AcumulateMessageBody(BrokerPacket messagePacket, int messageLenght, int offset)
 {
     _pendingAsyncResult = _clientSocket.BeginReceive(
         messagePacket.msgBodyHolder, offset, messageLenght, SocketFlags.None,
         new AsyncCallback(OnMessageBodyReceived), messagePacket);
 }