Skip to content

Commit c6c1aef

Browse files
committed
so_reuseport fixups
1 parent 593eef1 commit c6c1aef

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

lib/ruby-debug-ide.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,7 @@ def start_control(host, port, notify_dispatcher)
120120
server = notify_dispatcher_if_needed(host, port, notify_dispatcher) do |real_port, port_changed|
121121
s = Socket.new Socket::AF_INET, Socket::SOCK_STREAM
122122

123-
if Debugger.is_windows
124-
reuse_opt = Socket::SO_REUSEADDR
125-
else
126-
reuse_opt = Socket::SO_REUSEPORT
127-
end
128-
s.setsockopt Socket::SOL_SOCKET, reuse_opt, true
123+
s.setsockopt Socket::SOL_SOCKET, Debugger.is_windows ? Socket::SO_REUSEADDR : Socket::SO_REUSEPORT, true
129124

130125
s.bind Addrinfo.tcp host, real_port
131126
s.listen 0
@@ -195,6 +190,8 @@ def notify_dispatcher_if_needed(host, port, need_notify)
195190
sleep 0.3
196191
end unless connected
197192
end
193+
194+
nil
198195
end
199196
end
200197

lib/ruby-debug-ide/multiprocess/pre_child.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def pre_child(options = nil)
99
'frame_bind' => false,
1010
'host' => ENV['DEBUGGER_HOST'],
1111
'load_mode' => false,
12-
'port' => ENV['DEBUGGER_PORT'],
12+
'port' => ENV['DEBUGGER_PORT'],
1313
'stop' => false,
1414
'tracing' => false,
1515
'int_handler' => true,

0 commit comments

Comments
 (0)