improved connecting to the server, now with timeout and basic error handling, started a listening function for receiving all messages at a client, implementation not finished yet