lib/asir/transport/tcp_socket.rb in asir-0.2.0 vs lib/asir/transport/tcp_socket.rb in asir-1.0.1
- old
+ new
@@ -18,13 +18,14 @@
@server = TCPServer.open(port)
@server.setsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE, false)
end
def _server_accept_connection! server
- server.accept
+ socket = server.accept
+ [ socket, socket ] # Use same socket for in_stream and out_stream
end
- def _server_close_connection! stream
+ def _server_close_connection! stream, out_stream
stream.close rescue nil
end
end
# !SLIDE END
end # class