def METHOD_NAME(self):
    # Perform handshake as specified in
    # https://github.com/NetworkBlockDevice/nbd/blob/master/doc/proto.md
    nbd_magic = self._s.recv(len("NBDMAGIC"))
    assert(nbd_magic == b'NBDMAGIC')
    buf = self._s.recv(8)
    (magic,) = struct.unpack(">Q", buf)
    if magic == 0x49484156454F5054:
        self._new_style_handshake(magic)
    else:
        self._old_style_handshake(magic)