Lines Matching refs:sock
17 self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
20 self.sock.close()
24 self.assertEqual(self.sock.gettimeout(), None,
29 self.sock.settimeout(7.345)
30 self.assertEqual(self.sock.gettimeout(), 7.345)
32 self.sock.settimeout(3)
33 self.assertEqual(self.sock.gettimeout(), 3)
35 self.sock.settimeout(None)
36 self.assertEqual(self.sock.gettimeout(), None)
40 self.sock.settimeout(1)
41 self.assertEqual(type(self.sock.gettimeout()), type(1.0))
43 self.sock.settimeout(3.9)
44 self.assertEqual(type(self.sock.gettimeout()), type(1.0))
48 self.sock.settimeout(0)
49 self.sock.settimeout(0L)
50 self.sock.settimeout(0.0)
51 self.sock.settimeout(None)
52 self.assertRaises(TypeError, self.sock.settimeout, "")
53 self.assertRaises(TypeError, self.sock.settimeout, u"")
54 self.assertRaises(TypeError, self.sock.settimeout, ())
55 self.assertRaises(TypeError, self.sock.settimeout, [])
56 self.assertRaises(TypeError, self.sock.settimeout, {})
57 self.assertRaises(TypeError, self.sock.settimeout, 0j)
61 self.assertRaises(ValueError, self.sock.settimeout, -1)
62 self.assertRaises(ValueError, self.sock.settimeout, -1L)
63 self.assertRaises(ValueError, self.sock.settimeout, -1.0)
67 self.sock.settimeout(10)
68 self.sock.setblocking(1)
69 self.assertEqual(self.sock.gettimeout(), None)
70 self.sock.setblocking(0)
71 self.assertEqual(self.sock.gettimeout(), 0.0)
73 self.sock.settimeout(10)
74 self.sock.setblocking(0)
75 self.assertEqual(self.sock.gettimeout(), 0.0)
76 self.sock.setblocking(1)
77 self.assertEqual(self.sock.gettimeout(), None)
81 self.sock.setblocking(0)
82 self.sock.settimeout(1)
83 self.assertEqual(self.sock.gettimeout(), 1)
85 self.sock.setblocking(1)
86 self.sock.settimeout(1)
87 self.assertEqual(self.sock.gettimeout(), 1)
102 self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
107 self.sock.close()
119 self.sock.settimeout(_timeout)
122 self.assertRaises(socket.error, self.sock.connect, addr)
135 self.sock.connect(self.addr_remote)
136 self.sock.settimeout(_timeout)
139 self.assertRaises(socket.timeout, self.sock.recv, 1024)
150 self.sock.settimeout(_timeout)
152 test_support.bind_port(self.sock, self.localhost)
153 self.sock.listen(5)
156 self.assertRaises(socket.error, self.sock.accept)
167 self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
168 self.sock.settimeout(_timeout)
170 test_support.bind_port(self.sock, self.localhost)
173 self.assertRaises(socket.error, self.sock.recvfrom, 8192)