To make it easy for the server to know which subclass of ServerConnection to create on detecting an incoming connection, incoming client and server connections are handled on separate ports. The server reads a ``base_port'' from the configuration file and then checks that base_port+1 and base_port+2 are available, otherwise it increments base_port by 3 and tries again. The base_port then listens for incoming client connections, base_port+1 listens for incoming server connections and the TCPechod is run on base_port+2.3.3
In StoSconnection, one of the problems encountered when writing the run() method was knowing how to differentiate between exiting from run() because the connection had died and when the other server had simply asked this server to disconnect (e.g. because it had reached a maximum number of connections). The solution was to make run() return a boolean value: true if it exited because of a disconnect message, false if the connection died in some way, indicating if the server should issue a deleteServer message. StoCconnection does not have this problem because no action is taken on a disconnect (the user's status cannot be updated to ``offline'' without a signature!).