public void CloseAllConnections() { if (isHost) { Server.CloseSockets(); } if (isClient) { Client.CloseClient(); } }