def main(): sock = Dragon(CLIENT, CPORT) # generator = Generator() fake_frame = bytearray(614400) sock.bind(('', 6000)) sock.send(fake_frame) open("dragon_send_frame","wb").write(fake_frame) print(f"CLEAN") time.sleep(3) sock.close()
def main(): sock = Dragon(SERVER, 6000) sock.bind(('', 7000)) data = b'' while True: try: tmp = sock.recv(1500) except KeyboardInterrupt: open("dragon_recv_frame", "wb").write(data) break if not tmp: break data += tmp # sock.send(b'Hello world!') sock.close()