Files correlati : Ricompilazione Demo : [ ] Commento : Migliorie varie sul frontend git-svn-id: svn://10.65.10.50/trunk@7679 c028cbd2-c16b-5b4b-a496-9718f37d4682
61 lines
1.4 KiB
C++
Executable File
61 lines
1.4 KiB
C++
Executable File
#ifndef __SERVER_H__
|
|
#define __SERVER_H__
|
|
|
|
#ifndef __NETSOCK_H__
|
|
#include "NetSock.h"
|
|
#endif
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// TDongleServer
|
|
|
|
class TDongleServer : public TSocketServer
|
|
{
|
|
enum { MAX_MODULES = 256 };
|
|
|
|
unsigned int _SerNo, _MaxUsers, _AssistanceYear;
|
|
unsigned short _int_tab[MAX_MODULES/16];
|
|
|
|
protected:
|
|
virtual BOOL OnConnect(const CString& topic);
|
|
virtual TConnection* OnCreateConnection(DWORD id);
|
|
virtual BOOL OnRemoveConnection(DWORD id);
|
|
|
|
BOOL HardlockLogin();
|
|
BOOL EutronLogin();
|
|
BOOL Login();
|
|
void Logout();
|
|
|
|
BOOL ReadHardlockWords(unsigned short reg, unsigned short num, unsigned short* data);
|
|
BOOL ReadEutronWords(unsigned short reg, unsigned short num, unsigned short* data);
|
|
|
|
int GetPeerConnections(const CString& strPeer) const;
|
|
|
|
public:
|
|
unsigned short SerialNumber() const
|
|
{ return _SerNo; }
|
|
|
|
unsigned short AssistanceYear() const
|
|
{ return _AssistanceYear; }
|
|
|
|
const unsigned short* Authorizations(unsigned short& nSize) const
|
|
{ nSize = sizeof(_int_tab); return _int_tab; }
|
|
|
|
unsigned short MaxUsers() const
|
|
{ return _MaxUsers; }
|
|
|
|
unsigned short Users() const;
|
|
unsigned short Peers() const;
|
|
|
|
BOOL CanClose() const;
|
|
|
|
TDongleServer();
|
|
virtual ~TDongleServer();
|
|
};
|
|
|
|
CString GetIniString(LPCSTR sec, LPCSTR key, LPCSTR def);
|
|
|
|
BOOL StartServer();
|
|
TDongleServer& GetServer();
|
|
BOOL StopServer();
|
|
|
|
#endif |