spec/support/mock_server.rb in ruby_fs-0.1.0 vs spec/support/mock_server.rb in ruby_fs-0.2.0
- old
+ new
@@ -24,9 +24,11 @@
def handle_connection(socket)
@clients << socket
_, port, host = socket.peeraddr
Logger.debug "MockServer Received connection from #{host}:#{port}"
loop { receive_data socket.readpartial(4096) }
+ rescue EOFError
+ Logger.debug "Connection from #{host}:#{port} closed"
end
def receive_data(data)
Logger.debug "ServerMock receiving data: #{data}"
@mock_target.receive_data data, self