Next Previous Contents

12.1 Text Protocol Server - launching and server loop

The code launching SurpriseServer and its main loop code is located in files src/server/surpriseserver.c and src/server/server.c . First, the command-line arguments are processed and passed appropriate parameters to the function launch_server() located in src/server/server.c. This function starts listening on a port if demanded and starts the server main loop. It waits for input and serves the client's demands (description of underlying language can be found in section Description of Text Protocol API). The client's demands are served as follows:

If an error occurs the function prints out error message(s) and starts waiting for the client's next demand.


Next Previous Contents