int connect(string host, int port, void|int timeout)
This function is called by clients to connect to a server.