rasdaman complete source
|
#include <akgnet_nbcomm.hh>
Public Member Functions | |
NbClientJob () throw () | |
Default constructor. More... | |
bool | connectToServer (const char *serverHost, int serverPort) throw () |
Returns 'true' if connection succeded. More... | |
void | initOnAttach (Selector *pselector) throw () |
acceptStatus | acceptConnection (ListenSocket &listenSocket) throw () |
![]() | |
virtual | ~NbJob () throw () |
workingStatus | getStatus () throw () |
Returns the working status. More... | |
bool | isOperationPending () throw () |
bool | isAccepting () throw () |
Returns true if the job is ready to accept a connection. More... | |
bool | isReading () throw () |
Returns true if the job is reading data. More... | |
bool | isWriting () throw () |
Returns true if the job is writing data. More... | |
bool | isProcessing () throw () |
Returns true if the job is processing. More... | |
bool | readPartialMessage () throw () |
bool | writePartialMessage () throw () |
void | clearConnection () throw () |
Clears the connection - closes the socket and removes it from the Selector. More... | |
int | getSocket () throw () |
Returns the OS file descriptor for the socket. More... | |
int | getErrno () throw () |
Returns the errno of the last socket operation. More... | |
virtual bool | cleanUpIfTimeout () throw () |
virtual void | processRequest ()=0 throw () |
Protected Member Functions | |
void | readyToReadAnswer () throw () |
helper function, call it in 'executeOnWriteReady()' to switch to reading More... | |
![]() | |
virtual bool | validateMessage ()=0 throw () |
called after every read, returns 'true' if the message is all here More... | |
virtual void | executeOnAccept () throw () |
called when client is accepted, default does nothing More... | |
virtual void | executeOnWriteReady ()=0 throw () |
called when message is written More... | |
virtual void | specificCleanUpOnTimeout ()=0 throw () |
called when timeout, it has to set the status apropriate and do other cleanup More... | |
virtual void | executeOnReadError ()=0 throw () |
called when a read error occurs, usual a message and clean up More... | |
virtual void | executeOnWriteError ()=0 throw () |
called when a write error occurs, usual a message and clean up More... | |
NbJob (FileDescriptor &) throw () | |
Protected constructor, taking a FileDescriptor, usually a Socket. More... | |
bool | setReading () throw () |
Helper function for setting the job in read modus. More... | |
bool | setWriting () throw () |
Helper function for setting the job in write modus. More... | |
void | action () throw () |
Helper function which marks the current moment, so timeout counter is reset. More... | |
Protected Attributes | |
ClientSocket | clientSocket |
![]() | |
workingStatus | status |
FileDescriptor & | fdRef |
Selector * | selectorPtr |
CommBuffer * | currentBufferPtr |
time_t | lastActionTime |
Additional Inherited Members | |
![]() | |
enum | acceptStatus { acs_nopending = 0, acs_Iambusy = 1, acs_accepted = 2 } |
Status regarding accepting a new job. More... | |
enum | workingStatus { wks_notdefined = 0, wks_accepting = 1, wks_reading = 2, wks_writing = 3, wks_processing = 4 } |
Status during the lifetime of a job. More... | |
![]() | |
static void | setCurrentTime () throw () |
static void | setTimeoutInterval (time_t x) throw () |
static time_t | getTimeoutInterval () throw () |
Returns the timeout interval set for the jobs. More... | |
![]() | |
static time_t | timeOutInterv |
static time_t | currentTime |
akg::NbClientJob::NbClientJob | ( | ) | ||
throw | ( | |||
) |
Default constructor.
|
virtual |
The version for clients. It just returns 'acs_Iambusy' since clients don't accept connections It doesn't have to be overloaded, it's OK for most clients
Implements akg::NbJob.
bool akg::NbClientJob::connectToServer | ( | const char * | serverHost, |
int | serverPort | ||
) | |||
throw | ( | ||
) |
Returns 'true' if connection succeded.
|
virtual |
The version for clients, it initializes the 'Selector*' and prepares for writing. It has to be called AFTER the connection to the server succeded! It doesn't have to be overloaded, it's OK for most clients
Implements akg::NbJob.
|
protected |
helper function, call it in 'executeOnWriteReady()' to switch to reading
|
protected |