如何关闭和关闭此特定连接?

时间:2019-04-12 07:52:31

标签: python sockets connection shutdown

如何关闭并关闭此特定连接?

import socket
import socks
from urllib.request import urlopen

socks.set_default_proxy(socks.SOCKS5, "localhost", 9150)
socket.socket = socks.socksocket
urlopen("http://www.sourceforge.net/")

我已经尝试过socket.socket.shutdown(socket.SHUT_RDWR),但这根本不起作用:

TypeError: descriptor 'shutdown' requires a '_socket.socket' object but received a 'int'

0 个答案:

没有答案