'Try to read a HANDSHAKE request
:return: False if command could not been processes due to lack of bytes, True otherwise'

def _try_handshake(self):

    (offset, request) = conversion.decode_methods_request(0, self.buffer)
    if (request is None):
        return False
    assert isinstance(request, conversion.MethodRequest), request
    self.buffer = self.buffer[offset:]
    if ((request.version != 5) or (0 not in request.methods)):
        self._logger.error('Client    has    sent    INVALID    METHOD    REQUEST')
        self.buffer = ''
        self.close()
    else:
        self._logger.info('Client    has    sent    METHOD    REQUEST')
        if (self.state is not ConnectionState.CONNECTED):
            response = conversion.encode_method_selection_message(conversion.SOCKS_VERSION, 0)
            self.transport.write(response)
        self.state = ConnectionState.CONNECTED
        return True
