Skip to content

Commit 04e4681

Browse files
authored
Merge pull request #592 from BallAerospace/open_udp_read_first
closes #590 Open Udp read socket first
2 parents 475b3f9 + 00f6182 commit 04e4681

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/cosmos/interfaces/udp_interface.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,18 @@ def initialize(
7575
# the constructor and a new {UdpReadSocket} if the read_port was given in
7676
# the constructor.
7777
def connect
78+
@read_socket = UdpReadSocket.new(
79+
@read_port,
80+
@hostname,
81+
@interface_address,
82+
@bind_address) if @read_port
7883
@write_socket = UdpWriteSocket.new(
7984
@hostname,
8085
@write_dest_port,
8186
@write_src_port,
8287
@interface_address,
8388
@ttl,
8489
@bind_address) if @write_dest_port
85-
@read_socket = UdpReadSocket.new(
86-
@read_port,
87-
@hostname,
88-
@interface_address,
89-
@bind_address) if @read_port
9090
@thread_sleeper = nil
9191
end
9292

0 commit comments

Comments
 (0)