next up previous contents
Next: Handlers Up: Server Previous: The listener   Contents

Connection control

This application runs on a separate thread for each connected user. It is responsible for listening on the user socket on one hand and listening on the ICQ network on the other. The connection control function is implemented in the files:

In the connection control module we are introduced to the structure of ``link environment'' (struct link_env). This structure includes the ICQLINK of the connection (which is the session identifiers for the icqlib library as can be read in the icqlib manual submitted with this documentation) along with additional information about the connection. The link environment contains the following properties:

The main function of the connection control mechanism is connector(). This function is called when the thread is initiated and handles flow of control until the connection is closed.

The function first initializes the environment and then goes on a look that is active as long as the identifier in the environment is set to a true value.

In the loop, we check for information from the ICQ network and for information from the user.

Before the connection control function returns, it cleans the environment, releasing all allocated resources.


next up previous contents
Next: Handlers Up: Server Previous: The listener   Contents
Zvika Brakerski 2001-05-09