Skip to content

Commit

Permalink
chore(ws): set connect calls to reconnect: false
Browse files Browse the repository at this point in the history
  • Loading branch information
elmernocon committed Sep 13, 2024
1 parent 7bc7527 commit a8d7344
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ lobbyClient := connectionutils.NewLobbyWebSocketClient(conn)

// [optional] do something before Connecting

success, err := lobbyClient.Connect(true) // Connecting
success, err := lobbyClient.Connect(false) // Connecting
if err != nil {
// error
}
Expand Down
2 changes: 1 addition & 1 deletion docs/migration-guides/migration-guide-v0.72-to-v0.73.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ if err != nil {
panic(err)
}
lobbyClient := connectionutils.NewLobbyWebSocketClient(connection)
_, err = lobbyClient.Connect(true)
_, err = lobbyClient.Connect(false)
if err != nil {
panic(err)
}
Expand Down
6 changes: 3 additions & 3 deletions samples/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func main() {
panic(err)
}
lobbyClient := connectionutils.NewLobbyWebSocketClient(connection)
_, err = lobbyClient.Connect(true)
_, err = lobbyClient.Connect(false)
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -121,7 +121,7 @@ func main() {
panic(err)
}
lobbyClient := connectionutils.NewLobbyWebSocketClient(connection)
_, err = lobbyClient.Connect(true)
_, err = lobbyClient.Connect(false)
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -163,7 +163,7 @@ func main() {
}
}

//messageHandler is callback function how to handle incoming ws message
// messageHandler is callback function how to handle incoming ws message
var messageHandler = func(dataByte []byte) {
message, err := parser.UnmarshalResponse(dataByte)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion samples/tic-tac-toe/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func login() {
panic(err)
}
lobbyClient := connectionutils.NewLobbyWebSocketClient(connection)
_, err = lobbyClient.Connect(true)
_, err = lobbyClient.Connect(false)
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion samples/ws-client-refresh-token/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func main() {
fmt.Println("failed to make websocket connection")
}
lobbyClient := connectionutils.NewLobbyWebSocketClient(connection)
_, err = lobbyClient.Connect(true)
_, err = lobbyClient.Connect(false)
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion services-api/pkg/tests/integration/lobby_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func TestIntegrationNotification(t *testing.T) {
lobbyClient := connectionutils.NewLobbyWebSocketClient(connection)
assert.NotNil(t, lobbyClient)

success, err := lobbyClient.Connect(true)
success, err := lobbyClient.Connect(false)
assert.True(t, success)
assert.Nil(t, err, "err should be nil")

Expand Down
2 changes: 1 addition & 1 deletion services-api/pkg/tests/sdk/refreshToken_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func TestWebsocketRefresh_withMockServer(t *testing.T) {
assert.Nil(t, err, "err should be nil")

lobbyClient := connectionutils.NewLobbyWebSocketClient(connection)
success, err := lobbyClient.Connect(true)
success, err := lobbyClient.Connect(false)
assert.Nil(t, err, "err should be nil")
assert.True(t, success)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func TestWebSocketReconnect_Case1(t *testing.T) {
lobby := connectionutils.NewLobbyWebSocketClient(conn)
assert.NotNil(t, lobby)

success, err := lobby.Connect(true)
success, err := lobby.Connect(false)
assert.Nil(t, err)
assert.True(t, success)

Expand Down Expand Up @@ -179,7 +179,7 @@ func TestWebSocketReconnect_Case2(t *testing.T) {
lobby := connectionutils.NewLobbyWebSocketClient(conn)
assert.NotNil(t, lobby)

success, err := lobby.Connect(true)
success, err := lobby.Connect(false)
assert.Nil(t, err)
assert.True(t, success)

Expand Down

0 comments on commit a8d7344

Please sign in to comment.