Home | Packages | Files | Procedures | Classes | Keywords | External packages
Attach (connId) | ||
Reenables listening for commands for the given connection. See Detach too. | ||
Argument: connId | Connection identifier referencing into connMap. |
CloseConnection () | ||
Abstract method. Called by DoCloseConnection to execute class specific code. Should do any class specific cleanup for the connection in destruction. |
Detach (connId) | ||
After this call the given connection does not listen for commands anymore. This is useful to allow temporary operation of 'fcopy' et. al. The complementary command is Attach. | ||
Argument: connId | Connection identifier referencing into connMap. |
DoCloseConnection (connId) | ||
Closes the connection described by connId. Must be associated to this server. Closes the associated channel, then cleans and destroys the connection descriptor. Uses the abstract method CloseConnection to execute class specific code. | ||
Argument: connId | Connection identifier referencing into connMap. |
GreetPeer (connId) | ||
Abstract method. Called by HandleNewConnection to execute class specific code. Should sent a greeting message to the new client. | ||
Argument: connId | Connection identifier referencing into connMap. |
HandleCommand (connId sock) | ||
Called by the event system after arrival of a new command for connection connId. | ||
Argument: connId | Connection identifier referencing into connMap. | |
Argument: sock | Direct access to the channel representing the connection. |
HandleNewConnection (sock rHost rPort) | ||
A new connection to the server was opened. The connection descriptor is generated and initialized. A greeting will be sent upon sucessful completion of this task. In case of a failure the connection is closed immediately, without any response. Uses the abstract methods InitializeNewConnection and GreetPeer to execute class specific setup code and the greeting of the new client. | ||
Notes: This is the part of the code you have to change if you want to implement a host based access scheme. | ||
Argument: sock | The channel handle of the new connection. | |
Argument: rHost | The host the client resides on. | |
Argument: rPort | The port used by the client. |
HandleUnknownCmd (connId cmd line) | ||
Standard way of handling an unknown command sent by the client to us. The 'error' is catched in HandleCommand, reported via | ||
Argument: connId | Connection identifier referencing into connMap. | |
Argument: cmd | The name of the command not understood by the server. | |
Argument: line | The complete line sent by the client. |
InitializeNewConnection (connId) | ||
Abstract method. Called by HandleNewConnection to execute class specific code. Should do any class specific initializations for the new connection. | ||
Argument: connId | Connection identifier referencing into connMap. |
Log (level args) | ||
Convenience method, wraps around the syslog interface, automatically adds the server handle to the written text. See ::pool::syslog::syslog too. | ||
Argument: level | Relative importance of the logged message. Should be one of the strings returned by ::pool::syslog::levels. | |
Argument: args | List containing the texts to log. |
Respond2Client (conn ok text) | ||
Internal procedure. Writes a response text to the client represented by conn. To the caller it is equivalent to the builtin 'return'. | ||
Argument: conn | Descriptor of connection to write to. | |
Argument: ok | Primary response, specific to the server subclass | |
Argument: text | Additional text following the primary response. |
SetCmdMap (map) | ||
Used by derived classes to establish the mapping from command names to their handler methods. | ||
Argument: map | The mapping in 'array set/get' format. |
managesSock (sock) | ||
Used by the custom background handler in net/serverUtil.tcl to check wether a socket is handled by the queried server or not. | ||
Argument: sock | The handle of the socket to look for. | |
Returns: a boolean value. 1 indicates that the socket is handled here. |
reportError (sock errmsg) | ||
Reports an error in the underlying server, closes the affected connection. | ||
Argument: sock | Handle of the channel representing the connection. | |
Argument: errmsg | The message to print out. |
server () | ||
Constructor. Installs the custom background error handler upon the first call, see net/serverUtil.tcl. Always registers the new server in the map (<cv servers>) used by the error handler. |
start () | ||
A server is dormant until this method is called. |
~server () | ||
Destructor. This closes all currently open connections too. |
Generated by AutoDoc 2.1 at 02/20/1999, invoked by Andreas Kupries