コード例 #1
0
ファイル: serverapp.py プロジェクト: Aleksandre/YAM
def testServerAndPlayerIntegration():
    host, port = 'localhost', 5000
    server = RequestServer((host, port), player=LocalPlayer(), handler_class=YamRequestHandler)
    server.start()

    client = RemoteClient(host, port)
    client.sendRequest('player;getState')

    server.stop()
コード例 #2
0
ファイル: serverapp.py プロジェクト: Aleksandre/YAM
def testClientAndServer():
    host, port = 'localhost', 5000
    server = RequestServer((host, port), handler_class=EchoRequestHandler)
    server.start()

    client = RemoteClient(host, port)
    client.sendRequest('HELLO WORLD')

    import time
    time.sleep(1)
    client.sendRequest('Second message')

    server.stop()
    return 0