本文整理汇总了Python中monitor.Monitor.userListen方法的典型用法代码示例。如果您正苦于以下问题:Python Monitor.userListen方法的具体用法?Python Monitor.userListen怎么用?Python Monitor.userListen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类monitor.Monitor
的用法示例。
在下文中一共展示了Monitor.userListen方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Monitor
# 需要导入模块: from monitor import Monitor [as 别名]
# 或者: from monitor.Monitor import userListen [as 别名]
from router import Router
from monitor import Monitor
from server import Server
mon = Monitor("monitor", "", 5000)
r1 = Router("A", "", 5501)
r2 = Router("B", "", 5502)
r3 = Router("C", "", 5503)
r4 = Router("D", "", 5504)
r5 = Router("E", "", 5505)
r6 = Router("F", "", 5506)
r7 = Router("G", "", 5507)
r8 = Router("H", "", 5508)
r1.initConnections([])
r2.initConnections([("localhost", 5501)])
r3.initConnections([("localhost", 5501)])
r4.initConnections([("localhost", 5503)])
r5.initConnections([("localhost", 5503), ("localhost", 5504), ("localhost", 5502)])
r6.initConnections([("localhost", 5504)])
r7.initConnections([("localhost", 5506)])
r8.initConnections([("localhost", 5507), ("localhost", 5502), ("localhost", 5506)])
s = Server("server", "", 5678)
s.createConnection("localhost", 5508)
mon.userListen()