/// <summary> FIXME </summary> public void Read() { try { int bytesRead = ReadSome(readBuffer_, timeoutMilliseconds: 1000); if (bytesRead > 0) { parser_.AddToStream(System.Text.Encoding.UTF8.GetString(readBuffer_, 0, bytesRead)); } else if (null != qfSession_) { qfSession_.Next(); } ProcessStream(); } catch (MessageParseError e) { HandleExceptionInternal(qfSession_, e); } catch (System.Exception e) { HandleExceptionInternal(qfSession_, e); throw e; } }
/// <summary> FIXME </summary> public void Read() { try { int bytesRead = ReadSome(readBuffer_, 1000); if (bytesRead > 0) { parser_.AddToStream(readBuffer_, bytesRead); } else if (null != qfSession_) { qfSession_.Next(); } ProcessStream(); } catch (MessageParseError e) { HandleExceptionInternal(qfSession_, e); } catch (System.Exception e) { HandleExceptionInternal(qfSession_, e); throw e; } }
/// <summary> FIXME </summary> public void Read() { try { if (tcpClient_.Client.Poll(1000000, SelectMode.SelectRead)) // one-second timeout { int bytesRead = tcpClient_.Client.Receive(readBuffer_); if (bytesRead < 1) { throw new SocketException(System.Convert.ToInt32(SocketError.ConnectionReset)); } parser_.AddToStream(ref readBuffer_, bytesRead); } else if (null != qfSession_) { qfSession_.Next(); } ProcessStream(); } catch (MessageParseError e) { HandleException(qfSession_, e, tcpClient_); } catch (System.Exception e) { HandleException(qfSession_, e, tcpClient_); throw e; } }
public bool Read() { try { if (socket_.Poll(1000000, SelectMode.SelectRead)) // one-second timeout { int bytesRead = socket_.Receive(readBuffer_); if (0 == bytesRead) { throw new SocketException(System.Convert.ToInt32(SocketError.ConnectionReset)); } parser_.AddToStream(ref readBuffer_, bytesRead); } else if (null != session_) { session_.Next(); } else { throw new QuickFIXException("Initiator timed out while reading socket"); } ProcessStream(); return(true); } catch (System.ObjectDisposedException e) { // this exception means socket_ is already closed when poll() is called if (isDisconnectRequested_ == false) { // for lack of a better idea, do what the general exception does if (null != session_) { session_.Disconnect(e.ToString()); } else { Disconnect(); } } return(false); } catch (System.Exception e) { if (null != session_) { session_.Disconnect(e.ToString()); } else { Disconnect(); } return(false); } }
public bool Read() { try { int bytesRead = ReadSome(readBuffer_, 1000); if (bytesRead > 0) { parser_.AddToStream(readBuffer_, bytesRead); } else if (null != session_) { session_.Next(); } else { throw new QuickFIXException("Initiator timed out while reading socket"); } ProcessStream(); return(true); } catch (System.ObjectDisposedException e) { // this exception means socket_ is already closed when poll() is called if (isDisconnectRequested_ == false) { // for lack of a better idea, do what the general exception does if (null != session_) { session_.Disconnect(e.ToString()); } else { Disconnect(); } } return(false); } catch (System.Exception e) { if (null != session_) { session_.Disconnect(e.ToString()); } else { Disconnect(); } } return(false); }
public bool Read() { try { _log.Info("Read entered calling readsome"); int bytesRead = ReadSome(readBuffer_, 1000); if (bytesRead > 0) parser_.AddToStream(System.Text.Encoding.UTF8.GetString(readBuffer_, 0, bytesRead)); else if (null != session_) { _log.Info("Read calling sesson Next"); session_.Next(); _log.Info("Read called sesson Next"); } else { throw new QuickFIXException("Initiator timed out while reading socket"); } _log.Info("Read calling sesson ProcessStream"); ProcessStream(); _log.Info("Read called sesson ProcessStream"); return true; } catch (System.ObjectDisposedException e) { // this exception means socket_ is already closed when poll() is called if (isDisconnectRequested_ == false) { // for lack of a better idea, do what the general exception does if (null != session_) session_.Disconnect(e.ToString()); else Disconnect(); } return false; } catch (System.Exception e) { if (null != session_) session_.Disconnect(e.ToString()); else Disconnect(); } return false; }
public bool Read() { try { if (socket_.Poll(1000000, SelectMode.SelectRead)) // one-second timeout { int bytesRead = socket_.Receive(readBuffer_); if (0 == bytesRead) { throw new SocketException(System.Convert.ToInt32(SocketError.ConnectionReset)); } parser_.AddToStream(System.Text.Encoding.UTF8.GetString(readBuffer_, 0, bytesRead)); } else if (null != session_) { session_.Next(); } else { throw new QuickFIXException("Initiator timed out while reading socket"); } ProcessStream(); return(true); } catch (System.Exception e) { if (null != session_) { session_.Disconnect(e.Message); } else { Disconnect(); } return(false); } }