Lines Matching refs:select
26 import select
31 if not hasattr(select, "epoll"):
35 select.epoll()
67 ep = select.epoll(16)
76 if hasattr(select, "EPOLL_CLOEXEC"):
77 select.epoll(-1, select.EPOLL_CLOEXEC).close()
78 select.epoll(flags=select.EPOLL_CLOEXEC).close()
79 select.epoll(flags=0).close()
82 self.assertRaises(TypeError, select.epoll, 1, 2, 3)
83 self.assertRaises(TypeError, select.epoll, 'foo')
84 self.assertRaises(TypeError, select.epoll, None)
85 self.assertRaises(TypeError, select.epoll, ())
86 self.assertRaises(TypeError, select.epoll, ['foo'])
87 self.assertRaises(TypeError, select.epoll, {})
89 self.assertRaises(ValueError, select.epoll, 0)
90 self.assertRaises(ValueError, select.epoll, -2)
91 self.assertRaises(ValueError, select.epoll, sizehint=-2)
93 if hasattr(select, "EPOLL_CLOEXEC"):
94 self.assertRaises(OSError, select.epoll, flags=12356)
97 with select.epoll(16) as ep:
106 ep = select.epoll(2)
108 ep.register(server.fileno(), select.EPOLLIN | select.EPOLLOUT)
109 ep.register(client.fileno(), select.EPOLLIN | select.EPOLLOUT)
114 ep = select.epoll(2)
116 ep.register(server, select.EPOLLIN | select.EPOLLOUT)
117 ep.register(client, select.EPOLLIN | select.EPOLLOUT)
121 ep = select.epoll(2)
125 select.EPOLLIN | select.EPOLLOUT)
127 select.EPOLLIN | select.EPOLLOUT)
130 select.EPOLLIN | select.EPOLLOUT)
133 select.EPOLLIN | select.EPOLLOUT)
135 ep.register(server, select.EPOLLIN | select.EPOLLOUT)
137 select.EPOLLIN | select.EPOLLOUT)
144 with select.epoll(2) as ep:
145 ep2 = select.epoll.fromfd(ep.fileno())
147 ep2.register(server.fileno(), select.EPOLLIN | select.EPOLLOUT)
148 ep2.register(client.fileno(), select.EPOLLIN | select.EPOLLOUT)
165 ep = select.epoll(16)
167 select.EPOLLIN | select.EPOLLOUT | select.EPOLLET)
169 select.EPOLLIN | select.EPOLLOUT | select.EPOLLET)
177 expected = [(client.fileno(), select.EPOLLOUT),
178 (server.fileno(), select.EPOLLOUT)]
194 expected = [(client.fileno(), select.EPOLLIN | select.EPOLLOUT),
195 (server.fileno(), select.EPOLLIN | select.EPOLLOUT)]
200 ep.modify(server.fileno(), select.EPOLLOUT)
206 expected = [(server.fileno(), select.EPOLLOUT)]
210 self.assertRaises(ValueError, select.epoll, -2)
211 self.assertRaises(ValueError, select.epoll().register, -1,
212 select.EPOLLIN)
217 ep = select.epoll(16)
235 epoll = select.epoll()
250 self.assertRaises(ValueError, epoll.modify, fd, select.EPOLLIN)
252 self.assertRaises(ValueError, epoll.register, fd, select.EPOLLIN)
256 epoll = select.epoll()