//---------------------------------------------------------------------------- // Laser Guard Ltd. // Copyright © 2000-2002. All Rights Reserved. // Version 1.0 01/01/2000 // Last modification: 09/11/2003 // PROJECT: // SUBSYSTEM: // FILE: LgSocketServerConnection.h // AUTHOR: Sergey Chizhevskiy // OVERVIEW // ~~~~~~~~ // Header file of LgSocketServerConnection.h //---------------------------------------------------------------------------- #ifndef __LG__SOCKET__CONNECTION__H__INCLUDED__ #define __LG__SOCKET__CONNECTION__H__INCLUDED__ #if _MSC_VER > 1000 #pragma once #endif #include "LgSocket.h" template class CLgSocketServer; template class CLgSocketServerConnection : public BASE_SOCKET { public: CLgSocketServerConnection( CLgSocketServer* pServer ) { m_pServer = pServer; m_bDeletePending = FALSE; } virtual ~CLgSocketServerConnection() {} public: CLgSocketServer* GetServer() { return m_pServer; } public: virtual void OnConnect( LPSOCKADDR_IN pSockAddr ) { LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CLgSocketServerConnection::OnConnect"), _T("%d.%d.%d.%d"), pSockAddr->sin_addr.S_un.S_un_b.s_b1, pSockAddr->sin_addr.S_un.S_un_b.s_b2, pSockAddr->sin_addr.S_un.S_un_b.s_b3, pSockAddr->sin_addr.S_un.S_un_b.s_b4 ); } virtual void OnClose(int nErrorCode) { BASE_SOCKET::OnClose(nErrorCode); m_pServer->OnCloseConnection( this ); } public: void DeletePending() { m_bDeletePending = TRUE; } BOOL IsDeletePending() { return m_bDeletePending; } private: CLgSocketServer *m_pServer; private: BOOL m_bDeletePending; }; #endif