def __read(self, timeout=None):
    data = self.read_function(4, timeout)
    (type, flags, length) = unpack('>ccH', data)
    if (ord(type) == NETBIOS_SESSION_MESSAGE):
        length |= (ord(flags) << 16)
    elif (ord(flags) & 1):
        length |= 65536
    data2 = self.read_function(length, timeout)
    return (data + data2)
def __read(self, timeout=None):
    data = self.read_function(4, timeout)
    (type, flags, length) = unpack('>ccH', data)
    if (ord(type) == NETBIOS_SESSION_MESSAGE):
        length |= (ord(flags) << 16)
    elif (ord(flags) & 1):
        length |= 65536
    data2 = self.read_function(length, timeout)
    return (data + data2)