Lines Matching refs:rd
53 rd, wr = socketpair()
54 self.addCleanup(rd.close)
56 return rd, wr
62 rd, wr = self.make_socketpair()
64 key = s.register(rd, selectors.EVENT_READ, "data")
66 self.assertEqual(key.fileobj, rd)
67 self.assertEqual(key.fd, rd.fileno())
78 self.assertRaises(KeyError, s.register, rd, selectors.EVENT_READ)
81 self.assertRaises(KeyError, s.register, rd.fileno(),
88 rd, wr = self.make_socketpair()
90 s.register(rd, selectors.EVENT_READ)
91 s.unregister(rd)
97 self.assertRaises(KeyError, s.unregister, rd)
102 rd, wr = self.make_socketpair()
103 r, w = rd.fileno(), wr.fileno()
106 rd.close()
115 rd, wr = self.make_socketpair()
116 r, w = rd.fileno(), wr.fileno()
120 rd.close()
132 rd, wr = self.make_socketpair()
133 s.register(rd, selectors.EVENT_READ)
135 rd.close()
137 s.unregister(rd)
144 rd, wr = self.make_socketpair()
146 key = s.register(rd, selectors.EVENT_READ)
149 key2 = s.modify(rd, selectors.EVENT_WRITE)
151 self.assertEqual(key2, s.get_key(rd))
153 s.unregister(rd)
159 key = s.register(rd, selectors.EVENT_READ, d1)
160 key2 = s.modify(rd, selectors.EVENT_READ, d2)
163 self.assertEqual(key2, s.get_key(rd))
174 s.modify(rd, selectors.EVENT_READ, d3)
198 rd, wr = self.make_socketpair()
199 s.register(rd, selectors.EVENT_READ)
202 s.modify(rd, selectors.EVENT_WRITE)
210 rd, wr = self.make_socketpair()
212 s.register(rd, selectors.EVENT_READ)
216 self.assertRaises(RuntimeError, s.get_key, rd)
218 self.assertRaises(KeyError, mapping.__getitem__, rd)
225 rd, wr = self.make_socketpair()
227 key = s.register(rd, selectors.EVENT_READ, "data")
228 self.assertEqual(key, s.get_key(rd))
237 rd, wr = self.make_socketpair()
243 key = s.register(rd, selectors.EVENT_READ, "data")
244 self.assertIn(rd, keys)
245 self.assertEqual(key, keys[rd])
247 self.assertEqual(list(keys), [rd.fileno()])
256 del keys[rd]
262 rd, wr = self.make_socketpair()
264 s.register(rd, selectors.EVENT_READ)
280 rd, wr = self.make_socketpair()
283 sel.register(rd, selectors.EVENT_READ)
286 self.assertRaises(RuntimeError, s.get_key, rd)
311 rd, wr = self.make_socketpair()
312 s.register(rd, selectors.EVENT_READ)
314 readers.append(rd)
316 r2w[rd] = wr
317 w2r[wr] = rd
341 rd = ready_readers[0]
342 buf = rd.recv(MSG_LEN)
345 s.unregister(r2w[rd])
346 s.unregister(rd)
347 writers.remove(r2w[rd])
364 rd, wr = self.make_socketpair()
373 s.register(rd, selectors.EVENT_READ)
392 rd, wr = self.make_socketpair()
406 s.register(rd, selectors.EVENT_READ)
422 rd, wr = self.make_socketpair()
430 s.register(rd, selectors.EVENT_READ)
467 rd, wr = self.make_socketpair()
475 s.register(rd, selectors.EVENT_READ)