예제 #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()
예제 #2
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()
예제 #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()
예제 #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()
예제 #5
0
파일: server.py 프로젝트: kylewu/wwb_dtn
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''

    Author:
        Wenbin Wu <*****@*****.**>
        http://www.wenbinwu.com
 
    File:             server.py
    Create Date:      Wed Mar 23 12:02:08 2011

'''

from DTNSiteManager import SiteManagerServer

ip = '130.238.8.164'
# m_port dtn_port, bcast_port
server = SiteManagerServer(4001, 4005, 5555, ip)
server.start()