Beispiel #1
0
    def test_server(self):
        client = SiteManagerClient(4001, 4445, 4002, 4003, 5555,
                                   '130.238.8.164', 4005, '130.238.8.164')
        client.start()

        #carrier = SiteManagerCarrier()
        #carrier.start()

        time.sleep(5)

        server = SiteManagerServer(4006, 4005, 4000, '130.238.8.164')
        server.start()

        time.sleep(5)
        server.quit()

        time.sleep(5)

        print 'ressssssssssssss'
        server = SiteManagerServer(4006, 4005, 4000, '130.238.8.164')
        server.start()

        time.sleep(5)

        print 'client'
        for m in [msg for msg in client.db.select_all()]:
            print m

        print 'server'
        for m in [msg for msg in server.db.select_all()]:
            print m

        server.stop()
        client.stop()
Beispiel #2
0
def test3():

    client = SiteManagerClient(4000, 4445, 4003, 5555, ip, 4005,
                               '130.238.8.164')
    client.start()

    server = SiteManagerServer(4001, 4015, 5555, ip)
    server.start()

    time.sleep(60)

    client.stop()
    client.clean()
    server.stop()
    server.quit()
Beispiel #3
0
def test3():

    client = SiteManagerClient(4000, 4445, 4003, 5555, ip, 4005, '130.238.8.164')
    client.start()

    server = SiteManagerServer(4001, 4015, 5555, ip)
    server.start()

    time.sleep(60)

    client.stop()
    client.clean()
    server.stop()
    server.quit()
Beispiel #4
0
def test1():
    # m_port dtn_port, bcast_port
    server = SiteManagerServer(4001, 4005, 5555, ip)
    server.start()

    client1 = SiteManagerClient(4000, 4445, 4003, 5555, ip, 4005,
                                '130.238.8.164')
    client1.start()
    time.sleep(3)
    client1.stop()
    #client1.join()
    client1.clean()

    time.sleep(3)

    #client2 = SiteManagerClient(4000, 4445, 4003, 5555, ip, 4005, '130.238.8.164')
    #client2.start()
    #time.sleep(3)
    #client2.stop()
    ##client2.join()
    #client2.clean()

    server.quit()
Beispiel #5
0
def test2():
    client = SiteManagerClient(4000, 4445, 4003, 5555, ip, 4005,
                               '130.238.8.164')
    client.start()

    server1 = SiteManagerServer(4001, 4005, 5555, ip)
    server1.start()
    time.sleep(3)
    server1.stop()
    #server1.join()
    server1.quit()

    time.sleep(3)

    server2 = SiteManagerServer(4001, 4005, 5555, ip)
    server2.start()
    time.sleep(3)
    server2.stop()
    #server2.join()
    server2.quit()

    client.stop()
    #client.join()
    client.clean()
Beispiel #6
0
def test1():
    # m_port dtn_port, bcast_port
    server = SiteManagerServer(4001, 4005, 5555, ip)
    server.start()

    client1 = SiteManagerClient(4000, 4445, 4003, 5555, ip, 4005, '130.238.8.164')
    client1.start()
    time.sleep(3)
    client1.stop()
    #client1.join()
    client1.clean()

    time.sleep(3)

    #client2 = SiteManagerClient(4000, 4445, 4003, 5555, ip, 4005, '130.238.8.164')
    #client2.start()
    #time.sleep(3)
    #client2.stop()
    ##client2.join()
    #client2.clean()

    server.quit()
Beispiel #7
0
def test2():
    client = SiteManagerClient(4000, 4445, 4003, 5555, ip, 4005, '130.238.8.164')
    client.start()

    server1 = SiteManagerServer(4001, 4005, 5555, ip)
    server1.start()
    time.sleep(3)
    server1.stop()
    #server1.join()
    server1.quit()

    time.sleep(3)

    server2 = SiteManagerServer(4001, 4005, 5555, ip)
    server2.start()
    time.sleep(3)
    server2.stop()
    #server2.join()
    server2.quit()

    client.stop()
    #client.join()
    client.clean()
Beispiel #8
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''

    Author:
        Wenbin Wu <*****@*****.**>
        http://www.wenbinwu.com
 
    File:             client.py
    Create Date:      Wed 23 Mar 2011 12:04:17 PM CET

'''

import time
from DTNSiteManager import SiteManagerClient

ip = '130.238.8.164'
client = SiteManagerClient(4000, 4445, 4003, 5555, ip, 4005, '130.238.8.164')
client.start()

#time.sleep(10)

#client.stop()
#client.join()
#client.clean()