void LogOnConnect(CONNID dwConnID, const CString& strAddress, USHORT usPort) { LPTSTR lpszContent = new TCHAR[100]; wsprintf(lpszContent, _T("local address: %s:%d"), strAddress, usPort); int content_len = lstrlen(lpszContent); info_msg* msg = info_msg::Construct(dwConnID, EVT_ON_CONNECT, content_len, lpszContent); LogInfoMsg(msg); }
void PostOnPrepareListen(LPCTSTR lpszAddress, USHORT usPort) { LPTSTR lpszContent = new TCHAR[100]; wsprintf(lpszContent, _T("bind address: %s:%d"), lpszAddress, usPort); int content_len = lstrlen(lpszContent); info_msg* msg = info_msg::Construct(0, EVT_ON_PREPARE_LISTEN, content_len, lpszContent); LogInfoMsg(msg); }
void PostOnPrepareConnect(CONNID dwConnID) { info_msg* msg = info_msg::Construct(dwConnID, EVT_ON_PREPARE_CONNECT, 0, nullptr); LogInfoMsg(msg); }
void LogOnClose(CONNID dwConnID, LPCTSTR lpszName) { info_msg* msg = info_msg::Construct(dwConnID, EVT_ON_CLOSE, 0, nullptr, lpszName); LogInfoMsg(msg); }