Python socket 實現簡單的server-client聊天

Server import socket host = '127.0.0.1' port = 9999 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # s.setsockopt() s.bind((host,port)) s.listen(1) while True: conn, addr = s.accept()
相關文章
相關標籤/搜索