how to get connection with server