Skip to content

Commit

Permalink
fix mockserver
Browse files Browse the repository at this point in the history
  • Loading branch information
outdead committed Jul 22, 2019
1 parent 969306e commit 660c8b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion rcon.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const (
// regardless of the value of the request ID.
SERVERDATA_AUTH_ID int32 = 42

// SERVERDATA_RESPONSE_VALUE packet is a notification of the conn's current auth
// SERVERDATA_AUTH_RESPONSE packet is a notification of the conn's current auth
// status. When the server receives an auth request, it will respond with an empty
// SERVERDATA_RESPONSE_VALUE, followed immediately by a SERVERDATA_AUTH_RESPONSE
// indicating whether authentication succeeded or failed. Note that the status
Expand Down
8 changes: 5 additions & 3 deletions rcon_mockserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ func (s *MockServer) Close() error {
close(s.quit)

err := s.listener.Close()

// Waiting for server connections.
s.wg.Wait()

// And close remaining connections.
s.mu.Lock()
for c := range s.connections {
// Close connections and add original error if occurred.
Expand All @@ -65,9 +70,6 @@ func (s *MockServer) Close() error {
}
s.mu.Unlock()

// Waiting for server connections.
s.wg.Wait()

return err
}

Expand Down

0 comments on commit 660c8b2

Please sign in to comment.