code: def new_scansock (self):
          
          port = None
          try:
              self.sock.sendall("STREAM")
              port = None
              for dummy in range(60):
                  data = self.sock.recv(self.sock_rcvbuf)
                  i = data.find("PORT")
                  if i != -1:
                      port = int(data[i+5:])
                      break
          except socket.error:
              self.sock.close()
              raise
          if port is None:
              raise ClamavError(_("clamd is not ready for stream scanning"))
          sockinfo = get_sockinfo(self.host, port=port)
          wsock = create_socket(socket.AF_INET, socket.SOCK_STREAM)
          try:
              wsock.connect(sockinfo[0][4])
          except socket.error:
              wsock.close()
              raise
          return wsock
docs: Return a connected socket for sending scan data to it.