本文整理汇总了Python中exabgp.reactor.network.outgoing.Outgoing._writer方法的典型用法代码示例。如果您正苦于以下问题:Python Outgoing._writer方法的具体用法?Python Outgoing._writer怎么用?Python Outgoing._writer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类exabgp.reactor.network.outgoing.Outgoing
的用法示例。
在下文中一共展示了Outgoing._writer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test
# 需要导入模块: from exabgp.reactor.network.outgoing import Outgoing [as 别名]
# 或者: from exabgp.reactor.network.outgoing.Outgoing import _writer [as 别名]
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('-')