ipv6, ipv4 for client

pull/86/head
macos 2020-06-17 18:52:30 +08:00
parent d94e6cadbf
commit ddea313536
2 changed files with 2 additions and 4 deletions

View File

@ -280,8 +280,7 @@ if __name__ == '__main__':
while True:
try:
print("Connecting...")
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((SERVER, PORT))
s = socket.create_connection((SERVER, PORT))
data = byte_str(s.recv(1024))
if data.find("Authentication required") > -1:
s.send(byte_str(USER + ':' + PASSWORD + '\n'))

View File

@ -260,8 +260,7 @@ if __name__ == '__main__':
while 1:
try:
print("Connecting...")
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((SERVER, PORT))
s = socket.create_connection((SERVER, PORT))
data = byte_str(s.recv(1024))
if data.find("Authentication required") > -1:
s.send(byte_str(USER + ':' + PASSWORD + '\n'))