internal ClientHandlerThread(TcpClient tcpClient, long clientId, QuickFix.Dictionary settingsDict, SocketSettings socketSettings, AcceptorSocketDescriptor acceptorDescriptor ) { string debugLogFilePath = "log"; if (settingsDict.Has(SessionSettings.DEBUG_FILE_LOG_PATH)) { debugLogFilePath = settingsDict.GetString(SessionSettings.DEBUG_FILE_LOG_PATH); } else if (settingsDict.Has(SessionSettings.FILE_LOG_PATH)) { debugLogFilePath = settingsDict.GetString(SessionSettings.FILE_LOG_PATH); } var sessionId = new SessionID("ClientHandlerThread", clientId.ToString(), "Debug"); try { // FIXME - do something more flexible than hardcoding a filelog log_ = new FileLog(debugLogFilePath, sessionId); } catch { // TODO: fix this the correct way log_ = new ScreenLog(sessionId, true, true, true); } this.Id = clientId; socketReader_ = new SocketReader(tcpClient, socketSettings, this, acceptorDescriptor); }
public ClientHandlerThread(TcpClient tcpClient, long clientId) { log_ = new FileLog("log", new SessionID("ClientHandlerThread", clientId.ToString(), "Debug")); /// FIXME tcpClient_ = tcpClient; id_ = clientId; socketReader_ = new SocketReader(tcpClient_, this); }
public void Dispose() { if (socketReader_ != null) { socketReader_.Dispose(); socketReader_ = null; } if (log_ != null) { log_.Dispose(); log_ = null; } }
/// <summary> /// Creates a ClientHandlerThread /// </summary> /// <param name="tcpClient"></param> /// <param name="clientId"></param> /// <param name="debugLogFilePath">path where thread log will go</param> public ClientHandlerThread(TcpClient tcpClient, long clientId, QuickFix.Dictionary settingsDict, SocketSettings socketSettings) { string debugLogFilePath = "log"; if (settingsDict.Has(SessionSettings.DEBUG_FILE_LOG_PATH)) debugLogFilePath = settingsDict.GetString(SessionSettings.DEBUG_FILE_LOG_PATH); else if (settingsDict.Has(SessionSettings.FILE_LOG_PATH)) debugLogFilePath = settingsDict.GetString(SessionSettings.FILE_LOG_PATH); // FIXME - do something more flexible than hardcoding a filelog log_ = new FileLog(debugLogFilePath, new SessionID("ClientHandlerThread", clientId.ToString(), "Debug")); this.Id = clientId; socketReader_ = new SocketReader(tcpClient, socketSettings, this); }
/// <summary> /// Creates a ClientHandlerThread /// </summary> /// <param name="tcpClient"></param> /// <param name="clientId"></param> /// <param name="debugLogFilePath">path where thread log will go</param> public ClientHandlerThread(TcpClient tcpClient, long clientId, QuickFix.Dictionary settingsDict, SocketSettings socketSettings) { string debugLogFilePath = "log"; if (settingsDict.Has(SessionSettings.DEBUG_FILE_LOG_PATH)) { debugLogFilePath = settingsDict.GetString(SessionSettings.DEBUG_FILE_LOG_PATH); } else if (settingsDict.Has(SessionSettings.FILE_LOG_PATH)) { debugLogFilePath = settingsDict.GetString(SessionSettings.FILE_LOG_PATH); } // FIXME - do something more flexible than hardcoding a filelog log_ = new FileLog(debugLogFilePath, new SessionID("ClientHandlerThread", clientId.ToString(), "Debug")); this.Id = clientId; socketReader_ = new SocketReader(tcpClient, socketSettings, this); }
internal ClientHandlerThread(TcpClient tcpClient, long clientId, QuickFix.Dictionary settingsDict, SocketSettings socketSettings, AcceptorSocketDescriptor acceptorDescriptor) { string debugLogFilePath = ""; if (settingsDict.Has(SessionSettings.DEBUG_FILE_LOG_PATH)) { debugLogFilePath = settingsDict.GetString(SessionSettings.DEBUG_FILE_LOG_PATH); } //else if (settingsDict.Has(SessionSettings.FILE_LOG_PATH)) // debugLogFilePath = settingsDict.GetString(SessionSettings.FILE_LOG_PATH); // FIXME - do something more flexible than hardcoding a filelog if (!string.IsNullOrEmpty(debugLogFilePath)) { log_ = new FileLog(debugLogFilePath, new SessionID( "ClientHandlerThread", clientId.ToString(), "Debug-" + Guid.NewGuid().ToString())); } this.Id = clientId; socketReader_ = new SocketReader(tcpClient, socketSettings, this, acceptorDescriptor); }
protected virtual void Dispose(bool disposing) { if (_disposed) { return; } if (disposing) { if (socketReader_ != null) { socketReader_.Dispose(); socketReader_ = null; } if (log_ != null) { log_.Dispose(); log_ = null; } } _disposed = true; }
internal ClientHandlerThread(TcpClient tcpClient, long clientId, QuickFix.Dictionary settingsDict, SocketSettings socketSettings, AcceptorSocketDescriptor acceptorDescriptor) { string debugLogFilePath = "log"; if (settingsDict.Has(SessionSettings.DEBUG_FILE_LOG_PATH)) { debugLogFilePath = settingsDict.GetString(SessionSettings.DEBUG_FILE_LOG_PATH); } else if (settingsDict.Has(SessionSettings.FILE_LOG_PATH)) { debugLogFilePath = settingsDict.GetString(SessionSettings.FILE_LOG_PATH); } // FIXME - do something more flexible than hardcoding a filelog log_ = new FileLog(debugLogFilePath, new SessionID( "ClientHandlerThread", clientId.ToString(), "Debug-" + Guid.NewGuid().ToString())); this.Id = clientId; this.SourceAddress = ((IPEndPoint)tcpClient.Client.RemoteEndPoint).Address.ToString(); socketReader_ = new SocketReader(tcpClient, socketSettings, this, acceptorDescriptor); }