<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def connected(self):
 """ If connected to server. """

        return self.websocket is not None and \
               self.websocket.sock is not None and \
               self.websocket.sock.connected