public TcpClientManager(string ipAddress, int port, string key, int timeout) { mSocClient = new SyncSocClient(ipAddress, port, timeout); mSocClient.SocStatusChanged += TcpClientStatusChanged; mSocClient.SetKey(key); stateObj = new StateObject(mSocClient.getSocket()); stateObj.key = key; }
public static void info(StateObject arg) { if (level >= LOGLEVEL.INFO) WriteLine("[INFO ]", arg); }
public static void error(StateObject arg) { if (level >= LOGLEVEL.ERROR) WriteLine("[ERROR]", arg); }
static StreamWriter sw; // = new StreamWriter(SocConst.LOG_FILE + DateTime.Now.ToString("yyyyMMdd") + ".txt", true, Encoding.Default); #endregion Fields #region Methods public static void debug(StateObject arg) { if (level >= LOGLEVEL.DEBUG) WriteLine("[DEBUG]", arg); }
private static void WriteLine(string mode, StateObject arg) { LogWrite(mode, string.Format("[{0}]{1}", arg.key, arg.socMessage)); }