Old fashion design for PC-104
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

64 lines
1.7 KiB

//----------------------------------------------------------------------------
// 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 BASE_SOCKET>
class CLgSocketServer;
template<class BASE_SOCKET>
class CLgSocketServerConnection :
public BASE_SOCKET
{
public:
CLgSocketServerConnection( CLgSocketServer<BASE_SOCKET>* pServer )
{
m_pServer = pServer;
m_bDeletePending = FALSE;
}
virtual ~CLgSocketServerConnection() {}
public:
CLgSocketServer<BASE_SOCKET>* GetServer() { return m_pServer; }
public:
virtual void OnConnect( LPSOCKADDR_IN pSockAddr )
{
LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CLgSocketServerConnection<BASE_SOCKET>::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<BASE_SOCKET> *m_pServer;
private:
BOOL m_bDeletePending;
};
#endif