73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
# File 'lib/rtunnel/socket_factory.rb', line 73
def self.set_options(socket, options)
if options[:no_delay]
socket.setsockopt Socket::IPPROTO_TCP, Socket::TCP_NODELAY, true
socket.sync = true
end
if options[:reuse_addr]
socket.setsockopt Socket::SOL_SOCKET, Socket::SO_REUSEADDR, true
end
unless options[:reverse_lookup]
if socket.respond_to? :do_not_reverse_lookup
socket.do_not_reverse_lookup = true
else
BasicSocket.do_not_reverse_lookup = true
end
end
end
|