示例#1
0
 def _receive_cb(self, obj):
     self._buffer += self._decode(_sock.buff_from_obj(obj))
     while True:
         package, self._buffer = self._do_dispatch(self._buffer)
         if package:
             self.emit('package', package)
         else:
             break
示例#2
0
def recv_cb(self, obj, buff):
    buff['buff'] += SrtSock.buff_from_obj(obj)
    print(buff['buff'])
    if b'EXIT' in buff['buff']:
        print('exit')
        disconn_cb(self)