
Handheld Terminal
Software
User's Manual, Version: 1.3
89
© KEBA 2007
Server Implementation
The base of the server are the two classes
CKVCServer
and
CKVCConnection
. The class
CKVCServer
establishes and manages the
connections. The class
CKVCConnection
constitutes the actual connection.
To correctly implement a server, a derivation of the class
CKVCServer
is
needed.
class CKVCTestServer: public CKVCServer{
public:
CKVCTestServer();
virtual ~CKVCTestServer();
CKVCConnection* OnClientConnect(SOCKET socket, sockaddr_in
&sockAdr);
int OnClientDisconnect(CKVCConnection *pConnection,
TKVCDisconInfo info);
};
In this class, the method
OnClientConnect
must be overwritten.
In this method, a
CKVCConnection
object must be created and initialized.
CKVCConnection* CKVCTestServer::OnClientConnect(SOCKET
socket,
sockaddr_in &sockAdr){
CKVCTestConnection *pConnect = 0;
...
pConnect = new CKVCTestConnection();
if (pConnect != 0){
pConnect->Init(this, socket, sockAdr);
}
...
return pConnect;
}
The method
OnClientDisconnect
can be overwritten. But it must be guar-
anteed that the method
CKVCServer::OnClientDisconnect
is called in
this derivation.
int CKVCTestServer::OnClientDisconnect(CKVCConnection *pConnection,
TKVCDisconInfo info){
...
return CKVCServer::OnClientDisconnect(pConnection, info);
}
In the derivation of the class
CKVCConnection
, only the Event and Change
method must be derived. The Get methods can be derived, but it must be
guaranteed that the method of the base class is called before the data are
used.
class CKVCTestConnection: public CKVCConnection{
public:
CKVCTestConnection();
virtual ~CKVCTestConnection();
virtual int OnOverrideChange (SINT16 val);
virtual int OnWheelChange (SINT16 wheelAbsVal);
virtual int OnKeypadEvent (TKVCEvent keyEvent, UINT8 keyNum);
Содержание KeTop T50VGA
Страница 1: ...KeTop KeTop T50VGA Handheld Terminal User s Manual V 1 3 Translation of the original instructions ...
Страница 4: ...Änderungsverzeichnis KeTop T50VGA 4 User s Manual Version 1 3 KEBA 2007 ...
Страница 8: ...Inhalt KeTop T50VGA 8 User s Manual Version 1 3 KEBA 2007 ...
Страница 164: ...Conformity and Type Examination KeTop T50VGA 164 User s Manual Version 1 3 KEBA 2007 15 3Type Examination Certificate ...
Страница 165: ...Handheld Terminal Conformity and Type Examination User s Manual Version 1 3 165 KEBA 2007 ...