tcp客户端与服务器端建立连接需要经过三次握手过程,本文主要分析客户端主动打开中的第一次握手部分,即客户端发送syn段到服务器端: tcp_v4_connect为发起连接主流程,首先对必要参数进行检查,获取路由信息,改变连接状态成SYN_SENT,再调用inet_hash_connect将控制块加入到ehash,最后调用tcp_connect发送syn: /* This will initiate an outgoing connection. */ int tcp_v4_connect(str
Socket.io各个发送消息的含义 // send to current request socket client socket.emit('message', "this is a test"); // sending to all clients, include sender io.sockets.emit('message', "this is a test"); // sending to all clients except sender soc