Connect or disconnect to server.