Esempio n. 1
0
def main():
    host = sys.argv[1]
    port = int(sys.argv[2])
    if len(sys.argv) > 3:
        count = int(sys.argv[3])
    else:
        count = 1
    client = Client(host, port, timeout=1)
    for i in range(count):
        try:
            print client.call('ping').argv
        except:
            logging.exception('')
            client.close()
        time.sleep(0.5)
Esempio n. 2
0
 def test_connect(self):
     from stpclient import Client
     client = Client('localhost', 9999, timeout=1)
     assert not client.closed
     client.close()
     assert client.closed