def client(): S = Session() S.reader, S.writer = yield from asyncio.open_connection("127.0.0.1", 8888, loop=loop) h = ProtocolHandler(S, config) yield from h.start() yield from h.outgoing_queue.put(test_packet) yield from h.stop()
def client(): S = Session() S.reader, S.writer = yield from asyncio.open_connection("127.0.0.1", 8888, loop=loop) h = ProtocolHandler(S, config) yield from h.start() incoming_packet = yield from h.incoming_queues[PacketType.CONNECT].get() yield from h.stop() return incoming_packet