|
@Proton
应从代码中去除ipv4假定。
diff --git a/src/client/core/executive.py b/src.new/client/core/executive.py
index 4abad2f..12f3e4e 100644
--- a/src/client/core/executive.py
+++ b/src.new/client/core/executive.py
@@ -145,8 +145,7 @@ class Executive(object):
cb('server_already_connected')
return
try:
- s = socket.socket()
- s.connect(addr)
+ s = socket.create_connection(addr)
svr = Server.spawn(s, 'TheChosenOne')
self.server = svr
self.state = 'connected'
diff --git a/src/start_client.py b/src.new/start_client.py
index 842a702..5bee59f 100644
--- a/src/start_client.py
+++ b/src.new/start_client.py
@@ -41,7 +41,7 @@ class MainThread(threading.Thread):
def getaddrinfo_wrapper(host, port, family=0, socktype=0, proto=0, flags=0):
while True:
try:
- return orig_getaddrinfo(host, port, socket.AF_INET, socktype, proto, flags)
+ return orig_getaddrinfo(host, port, family, socktype, proto, flags)
except dns.DNSError as e:
if not e.errno == 2: # dns server fail thing
raise
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?加入幻想乡
x
|