当前位置: 首页>>代码示例>>Python>>正文


Python Server.join方法代码示例

本文整理汇总了Python中Server.Server.join方法的典型用法代码示例。如果您正苦于以下问题:Python Server.join方法的具体用法?Python Server.join怎么用?Python Server.join使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Server.Server的用法示例。


在下文中一共展示了Server.join方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: CBM1

# 需要导入模块: from Server import Server [as 别名]
# 或者: from Server.Server import join [as 别名]
            }

    CBM, CORE, SERVER = read_Config.read_Config(CBM, CORE, SERVER)

    condition1=threading.Condition()
    condition2=threading.Condition()
    condition3=threading.Condition()
    '''
        Check the Schedule configuration and check the file query before calling occured.
    '''
    cbm1    = CBM1(condition1, 'CBM1',CBM["hostname"],CBM["username"],CBM["RootPassword"],CBM["password"],CBM["port"])      #create two thread within a condition lock
    server  = Server(condition1,'Server',"202.38.35.184","bsmbin","Abcde01!",23,fileDirection,0)
    server.start()  #server start first but the thread will set to wait when acquire the lock
    cbm1.start()    #Though start later but the thread will finish its processing first
    cbm1.join()
    server.join()   #Main thread wait until the thread above finish their tasks

    '''
        Calling happens with the command sent in Core.And then CBM will check the FIlESYS to findout whether the Billing is in the query
    '''

    cbm2 = CBM2(condition2, 'CBM2',"10.178.28.26","nortel","nortel",22)         #create two thread within a condition lock
    core = Core(condition2,'Core',"10.24.16.134","lisa","lisa",23)
    cbm2.start()     #cbm2 start first but the thread will set to wait when acquire the lock
    core.start()     #Though start later but the thread will finish its processing first
    core.join()
    cbm2.join()      #Main thread wait until the thread above finish their tasks

    '''
        After the process above , Server will double check the Destination of billing to confirm whether the transfering is success.
    '''
开发者ID:JasonDean-1,项目名称:TestAutomation,代码行数:33,代码来源:TestAutomation.py

示例2: Server

# 需要导入模块: from Server import Server [as 别名]
# 或者: from Server.Server import join [as 别名]
               server_id='bob')
bob = Server(name='bob',
             g=g,
             p=p,
             input_queue=queue_to_server,
             output_queue=queue_to_client,
             rsa_obj=rsa_bob,
             keys=keys,
             client_id='alice')

assert alice.K is None
assert bob.K is None
assert alice.finished_successfully is None
assert bob.finished_successfully is None
alice.start()
bob.start()
alice.join(timeout=50)
bob.join(timeout=50)
killed = False
if alice.is_alive():
    alice._Thread__stop()
    killed = True
if bob.is_alive():
    bob._Thread__stop()
    killed = True
if killed:
    sys.exit(1)
assert alice.finished_successfully is True
assert bob.finished_successfully is True
assert alice.K == bob.K
开发者ID:jan-osch,项目名称:Station-To-Station-BSK,代码行数:32,代码来源:official_test.py

示例3: active_count

# 需要导入模块: from Server import Server [as 别名]
# 或者: from Server.Server import join [as 别名]
                 secret=(7, 21))

assert alice.successfully_finished is None
assert bob.successfully_finished is None
assert charlie.successfully_finished is None

server.start()

alice.start()
bob.start()
charlie.start()

killed = False
alice.join(timeout=30)
bob.join(timeout=30)
charlie.join(timeout=30)
server.finish()
server.join(timeout=30)

if active_count() > 1:
    for t in enumerate():
        if t != current_thread():
            print t
            t._Thread__stop()
    sys.exit(1)

assert alice.successfully_finished is True
assert bob.successfully_finished is True
assert charlie.successfully_finished is True

开发者ID:Platash,项目名称:UJ,代码行数:31,代码来源:test_jawny.py

示例4: active_count

# 需要导入模块: from Server import Server [as 别名]
# 或者: from Server.Server import join [as 别名]
server.start()

alice.start()
bob.start()
charlie.start()
david.start()
edvard.start()

killed = False
timeout = 300
alice.join(timeout=timeout)
bob.join(timeout=timeout)
charlie.join(timeout=timeout)
edvard.join(timeout=timeout)
david.join(timeout=timeout)
server.finish()
server.join(timeout=timeout)

if active_count() > 1:
    for t in threading.enumerate():
        if t != current_thread():
            print t
            t._Thread__stop()
    sys.exit(1)

assert alice.successfully_finished is True
assert bob.successfully_finished is True
assert charlie.successfully_finished is True
assert david.successfully_finished is True
assert edvard.successfully_finished is True
开发者ID:jan-osch,项目名称:Secret-Sharing-BSK,代码行数:32,代码来源:official_test_second.py


注:本文中的Server.Server.join方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。