就像在客户端套接字中
socket = Socket.new(AF_INET, SOCK_STREAM, 0)
sockaddr = Socket.pack_sockaddr_in(2200, 'localhost')
socket.connect_nonblock(sockaddr)
server_msg = socket.recv_nonblock(3058)
vs
clientSession = TCPSocket.new( "localhost",2200)
server_msg = socket.recv(3058)
就像在服务器中
socket = Socket.new(AF_INET, SOCK_STREAM, 0)
sockaddr = Socket.sockaddr_in(6212, 'localhost')
socket.bind(sockaddr)
socket.listen(5)
vs
server = TCPServer.new("localhost",3000)
在语法上是不同的还是在逻辑上我们应该使它们成为非阻塞的?