예제 #1
0
def test():
    OPEN = ''.join([
        chr(int(_, 16)) for _ in
        "FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 1D 01 04 78 14 00 5A 52 DB 00 45 00"
        .split()
    ])
    KEEP = ''.join([
        chr(int(_, 16)) for _ in
        "FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 00 04".split()
    ])

    from exabgp.reactor.network.outgoing import Outgoing
    connection = Outgoing(1, '82.219.0.5', '82.219.212.34')
    writer = connection._writer(OPEN)
    while writer() == False:
        pass
    writer = connection._writer(KEEP)
    while writer() == False:
        pass

    reader = connection.reader()

    for size, kind, header, body in reader:
        if size: print od(header + body)
        else: sys.stdout.write('-')
예제 #2
0
def test ():
	OPEN = ''.join([chr(int(_,16)) for _ in "FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 1D 01 04 78 14 00 5A 52 DB 00 45 00".split()])
	KEEP = ''.join([chr(int(_,16)) for _ in "FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 00 04".split()])

	from exabgp.reactor.network.outgoing import Outgoing
	connection = Outgoing(1,'82.219.0.5','82.219.212.34')
	writer=connection._writer(OPEN)
	while writer() == False:
		pass
	writer=connection._writer(KEEP)
	while writer() == False:
		pass

	reader=connection.reader()

	for size,kind,header,body in reader:
		if size: print od(header+body)
		else: sys.stdout.write('-')