Added functionality for client to connect to server.