Lines Matching full:sock
102 sock = None
126 if self.sock is not None:
132 if self.sock is not None:
151 self.sock = socket.create_connection((self.host, self.port), self.timeout,
153 self.af = self.sock.family
154 self.file = self.sock.makefile('r', encoding=self.encoding)
192 self.sock.sendall(line.encode(self.encoding))
262 self.sock.sendall(line, MSG_OOB)
304 sock = None
308 sock = socket.socket(af, socktype, proto)
309 sock.bind(sa)
312 if sock:
313 sock.close()
314 sock = None
317 if sock is None:
322 sock.listen(1)
323 port = sock.getsockname()[1] # Get proper port
324 host = self.sock.getsockname()[0] # Get proper host
330 sock.settimeout(self.timeout)
331 return sock
337 host, port = parse229(self.sendcmd('EPSV'), self.sock.getpeername())
378 with self.makeport() as sock:
387 conn, sockaddr = sock.accept()
675 sock = self.sock
676 self.sock = None
677 if sock is not None:
678 sock.close()
746 if secure and not isinstance(self.sock, ssl.SSLSocket):
752 if isinstance(self.sock, ssl.SSLSocket):
758 self.sock = self.context.wrap_socket(self.sock,
760 self.file = self.sock.makefile(mode='r', encoding=self.encoding)
765 if not isinstance(self.sock, ssl.SSLSocket):
768 self.sock = self.sock.unwrap()
805 self.sock.sendall(line)