Lines Matching refs:sock
119 def assertSocketClosed(self, sock): argument
120 self.assertRaisesErrno(ENOTCONN, sock.getpeername)
122 def assertSocketConnected(self, sock): argument
123 sock.getpeername() # No errors? Socket is alive and connected.
126 for sock in socketpair:
127 self.assertSocketClosed(sock)
158 def _EventDuringBlockingCall(self, sock, call, expected_errno, event): argument
169 thread = SocketExceptionThread(sock, call)
172 event(sock)
182 self.assertSocketClosed(sock)
184 def CloseDuringBlockingCall(self, sock, call, expected_errno): argument
186 sock, call, expected_errno,
187 lambda sock: self.sock_diag.CloseSocketFromFd(sock))
207 for sock in socketpair:
208 diag_msg = self.sock_diag.FindSockDiagFromFd(sock)
236 for sock in socketpair:
239 sock,
240 self.sock_diag.FindSockInfoFromFd(sock))
241 cookie = self.sock_diag.FindSockDiagFromFd(sock).id.cookie
244 req = self.sock_diag.DiagReqFromSocket(sock)
252 self.assertSockInfoMatchesSocket(sock, info)
388 for sock in socketpair:
389 diag_msg = self.sock_diag.FindSockDiagFromFd(sock)
390 cookie = sock.getsockopt(net_test.SOL_SOCKET, net_test.SO_COOKIE, 8)
514 def __init__(self, sock, operation): argument
518 self.sock = sock
523 self.operation(self.sock)
604 def CheckRstOnClose(self, sock, req, expect_reset, msg, do_close=True): argument
606 if sock is not None:
608 self.sock_diag.CloseSocketFromFd(sock)
609 self.assertRaisesErrno(EINVAL, sock.accept)
611 self.assertIsNone(sock, "Must specify sock or req, not both")
622 if sock is not None and do_close:
623 sock.close()
771 self.CloseDuringBlockingCall(self.s, lambda sock: sock.accept(), EINVAL)
781 self.CloseDuringBlockingCall(self.accepted, lambda sock: sock.recv(4096),
800 s, lambda sock: sock.connect((remotesockaddr, 53)), ECONNABORTED)
834 def BlockingPoll(self, sock, mask, expected, ignoremask): argument
836 p.register(sock, mask)
837 expected_fds = [(sock.fileno(), expected)]
844 def RstDuringBlockingCall(self, sock, call, expected_errno): argument
846 sock, call, expected_errno,
864 lambda sock: self.BlockingPoll(sock, mask, expected, ignoremask),
874 lambda sock: self.BlockingPoll(sock, mask, expected, ignoremask),
993 self.CloseDuringBlockingCall(s, lambda sock: sock.recv(4096),
1001 self.CloseDuringBlockingCall(s, lambda sock: sock.recv(4096),