标签:进程 als python bre block nec set dal close
client端:
# import time # import socket # sk = socket.socket(socket.AF_INET,socket.SOCK_STREAM) # # while True: # sk.connect((‘127.0.0.1‘,6667)) # print("hello") # sk.sendall(bytes("hello","utf8")) # time.sleep(2) # break
server端:
# import time # import socket # sk = socket.socket(socket.AF_INET,socket.SOCK_STREAM) # sk.bind((‘127.0.0.1‘,6667)) # sk.listen(5) # sk.setblocking(False) # print (‘waiting client connection .......‘) # while True: # try: # # connection,address = sk.accept() # 进程主动轮询 # print("+++",address) # client_messge = connection.recv(1024) # print(str(client_messge,‘utf8‘)) # connection.close() # except Exception as e: # print (e) # time.sleep(4)
标签:进程 als python bre block nec set dal close
原文地址:https://www.cnblogs.com/benchdog/p/9189501.html