Changed socket connection to read protocol version before sending commands