コード例 #1
0
ファイル: test_refcount.py プロジェクト: inercia/evy
def run_interaction (run_client):
    s, port = init_server()
    start_new_thread(handle_request, (s, run_client))
    if run_client:
        start_new_thread(make_request, (port,))
    sleep(0.1 + SOCKET_TIMEOUT)
    #print sys.getrefcount(s.fd)
    #s.close()
    return weakref.ref(s.fd)
コード例 #2
0
 def clientSetUp(self):
     # The is a hittable race between serverExplicitReady() and the
     # accept() call; sleep a little while to avoid it, otherwise
     # we could get an exception
     time.sleep(0.1)
     self.cli = socket.socket(socket.AF_TIPC, socket.SOCK_STREAM)
     addr = (socket.TIPC_ADDR_NAME, TIPC_STYPE,
             TIPC_LOWER + (TIPC_UPPER - TIPC_LOWER) / 2, 0)
     self.cli.connect(addr)
     self.cliaddr = self.cli.getsockname()
コード例 #3
0
ファイル: test_full_socket.py プロジェクト: inercia/evy
 def clientSetUp (self):
     # The is a hittable race between serverExplicitReady() and the
     # accept() call; sleep a little while to avoid it, otherwise
     # we could get an exception
     time.sleep(0.1)
     self.cli = socket.socket(socket.AF_TIPC, socket.SOCK_STREAM)
     addr = (socket.TIPC_ADDR_NAME, TIPC_STYPE,
             TIPC_LOWER + (TIPC_UPPER - TIPC_LOWER) / 2, 0)
     self.cli.connect(addr)
     self.cliaddr = self.cli.getsockname()
コード例 #4
0
 def testInsideTimeout(self):
     conn, addr = self.serv.accept()
     self.addCleanup(conn.close)
     time.sleep(3)
     conn.send("done!")
コード例 #5
0
 def _testRecv(self):
     self.cli.connect((HOST, self.port))
     time.sleep(0.1)
     self.cli.send(MSG)
コード例 #6
0
 def _testAccept(self):
     time.sleep(0.1)
     self.cli.connect((HOST, self.port))
コード例 #7
0
 def _testClose(self):
     self.cli.connect((HOST, self.port))
     time.sleep(1.0)
コード例 #8
0
ファイル: test_full_socket.py プロジェクト: inercia/evy
 def testInsideTimeout (self):
     conn, addr = self.serv.accept()
     self.addCleanup(conn.close)
     time.sleep(3)
     conn.send("done!")
コード例 #9
0
ファイル: test_full_socket.py プロジェクト: inercia/evy
 def _testRecv (self):
     self.cli.connect((HOST, self.port))
     time.sleep(0.1)
     self.cli.send(MSG)
コード例 #10
0
ファイル: test_full_socket.py プロジェクト: inercia/evy
 def _testAccept (self):
     time.sleep(0.1)
     self.cli.connect((HOST, self.port))
コード例 #11
0
ファイル: test_full_socket.py プロジェクト: inercia/evy
 def _testClose (self):
     self.cli.connect((HOST, self.port))
     time.sleep(1.0)