百度试题 结果1 题目简述计算机网络中的三次握手和四次挥手过程。相关知识点: 试题来源: 解析 三次握手建立连接,四次挥手断开连接。反馈 收藏
三次握手: ```python import socket client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client_socket.connect(('localhost', 8888)) client_socket.send(b'SYN') response = client_socket.recv(1024) if response == b'SYN-ACK': client_socket.send(b'ACK') ``` 四次挥手: ```...