Method: RTunnel::SocketFactory.set_options_on_accept_sockets

Defined in:
lib/rtunnel/socket_factory.rb

.set_options_on_accept_sockets(socket, options) ⇒ Object

new sockets coming out of socket.accept will have the given options set



95
96
97
98
99
100
101
102
# File 'lib/rtunnel/socket_factory.rb', line 95

def self.set_options_on_accept_sockets(socket, options)
  socket.instance_variable_set :@rtunnel_factory_options, options
  def socket.accept(*args)
    sock, addr = super
    RTunnel::SocketFactory.set_options sock, @rtunnel_factory_options
    return sock, addr
  end
end