Skip to content

Commit

Permalink
extended soak to incorporate client reconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
gafferongames committed Dec 26, 2023
1 parent 06358cf commit 3b3ba95
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions soak.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,21 @@ int SoakMain()

time += 0.1f;

if ( client.IsConnected() )
{
if ( ( rand() % 10000 ) == 0 )
{
printf( "client reconnect\n" );
client.Disconnect();
client.InsecureConnect( privateKey, clientId, serverAddress );
clientConnected = false;
numMessagesSentToServer = 0;
numMessagesSentToClient = 0;
numMessagesReceivedFromClient = 0;
numMessagesReceivedFromServer = 0;
}
}

if ( client.IsConnected() )
{
clientConnected = true;
Expand Down

0 comments on commit 3b3ba95

Please sign in to comment.