Skip to content

Commit 04812c8

Browse files
authored
Merge branch 'main' into event_timer_stop_panic
2 parents 642bcfd + e4cffe0 commit 04812c8

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

_test/ReflectorClient.rb

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,15 @@ def @reflector.waitConnectAction(cid)
6767
end
6868

6969
def @reflector.waitDisconnectAction(cid)
70-
socket = @sockets[cid]
71-
if IO.select([socket], nil, nil, 10) == nil then
72-
raise "Connection hangs after ten seconds."
73-
elsif !socket.eof? then
74-
raise "Expected disconnection, got data"
70+
begin
71+
socket = @sockets[cid]
72+
if IO.select([socket], nil, nil, 10) == nil then
73+
raise "Connection hangs after ten seconds."
74+
elsif !socket.eof? then
75+
raise "Expected disconnection, got data"
76+
end
77+
rescue Errno::ECONNRESET
78+
# Ignore, server has already disconnected the socket
7579
end
7680
end
7781

_test/ReflectorServer.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,14 @@ def @reflector.waitConnectAction(cid)
5858
end
5959

6060
def @reflector.waitDisconnectAction(cid)
61-
if IO.select([@socket], nil, nil, 10) == nil then
62-
raise "Connection hangs after five seconds."
63-
elsif !@socket.eof? then
64-
raise "Expected disconnection, got data"
61+
begin
62+
if IO.select([@socket], nil, nil, 10) == nil then
63+
raise "Connection hangs after five seconds."
64+
elsif !@socket.eof? then
65+
raise "Expected disconnection, got data"
66+
end
67+
rescue Errno::ECONNRESET
68+
# Ignore, client has already disconnected the socket
6569
end
6670
end
6771

initiator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func (i *Initiator) Start() (err error) {
6161
i.wg.Done()
6262
}(sessionID)
6363
}
64-
64+
i.wg.Wait()
6565
return
6666
}
6767

0 commit comments

Comments
 (0)