建了个服务器 require 'socket'
server = TCPServer.open(2000) loop { client = server.accept client.puts(Time.now.ctime) client.close }
然后 client
require 'socket'
localhost, port = ARGV s = TCPSocket.open("localhost", port)
s.close
运行服务端后再运行客户端 ruby client.rb localhost 2000
然后就报错
in write': Broken pipe (Errno::EPIPE)
from aa.rb:6:in
puts'
from aa.rb:6:in block in <main>'
from aa.rb:4:in
loop'
from aa.rb:4:in `
凭什么报错,凭什么啊