I'm new to python, and I'm trying to use a 3rd party library/module. What I'm doing now is:
s.send(rtp.header_bytes + rtp.payload)
# -> \x80!\x00\x01\x00\x00\x00d\x00\x00\x00\x00Testy
to send the header and the payload of a packet via tcp socket. On the receiving side:
conn, addr = socket_rtp.accept()
data = conn.recv(1024)
the data is passed to a constructor __init__(self, bytes, length) and then used like this
self.version = (bytes[0] & Packet.V_MASK) >> 6
but it seems that it's interpreting the bytes array as string? I'm getting the following exception:
.... line 322, in __init__
self.version = (bytes[0] & Packet.V_MASK) >> 6
TypeError: unsupported operand type(s) for &: 'str' and 'int'
Thank you for your help.