Client attempts to connect to the server for five seconds, using a TCP socket. If the client fails to secure a connection, it returns to the menu state.