public void Connect() { Debug.Assert(stream_ == null); stream_ = SetupStream(); session_.SetResponder(this); }
protected bool HandleNewSession(string msg) { if (qfSession_.HasResponder) { qfSession_.Log.OnIncoming(msg); qfSession_.Log.OnEvent("Multiple logons/connections for this session are not allowed (" + tcpClient_.Client.RemoteEndPoint + ")"); qfSession_ = null; DisconnectClient(); return(false); } else if (qfSession_.ValidateAcceptorPort && qfSession_.ExpectedAcceptorPort > 0) { int localPort = ((System.Net.IPEndPoint)tcpClient_.Client.LocalEndPoint).Port; if (localPort != qfSession_.ExpectedAcceptorPort) { qfSession_.Log.OnIncoming(msg); qfSession_.Log.OnEvent("Logon attempted to invalid port " + localPort.ToString() + " from session " + qfSession_.SessionID); qfSession_ = null; DisconnectClient(); return(false); } } qfSession_.Log.OnEvent(qfSession_.SessionID + " Socket Reader " + GetHashCode() + " accepting session " + qfSession_.SessionID + " from " + tcpClient_.Client.RemoteEndPoint); /// FIXME do this here? qfSession_.HeartBtInt = QuickFix.Fields.Converters.IntConverter.Convert(message.GetField(Fields.Tags.HeartBtInt)); /// FIXME qfSession_.Log.OnEvent(qfSession_.SessionID + " Acceptor heartbeat set to " + qfSession_.HeartBtInt + " seconds"); qfSession_.SetResponder(responder_); return(true); }
protected bool HandleNewSession(string msg) { if (qfSession_.HasResponder) { qfSession_.Log.OnIncoming(msg); qfSession_.Log.OnEvent("Multiple logons/connections for this session are not allowed (" + tcpClient_.Client.RemoteEndPoint + ")"); qfSession_ = null; DisconnectClient(); return(false); } qfSession_.Log.OnEvent(qfSession_.SessionID + " Socket Reader " + GetHashCode() + " accepting session " + qfSession_.SessionID + " from " + tcpClient_.Client.RemoteEndPoint); // FIXME do this here? qfSession_.HeartBtInt = QuickFix.Fields.Converters.IntConverter.Convert(message.GetField(Fields.Tags.HeartBtInt)); /// FIXME qfSession_.Log.OnEvent(qfSession_.SessionID + " Acceptor heartbeat set to " + qfSession_.HeartBtInt + " seconds"); qfSession_.SetResponder(responder_); return(true); }
public void Connect() { socket_.Connect(socketEndPoint_); session_.SetResponder(this); }