Skip to content

Commit

Permalink
server do not shut down the other one
Browse files Browse the repository at this point in the history
  • Loading branch information
ccyybn committed May 16, 2024
1 parent 88a02dd commit 263ca2f
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions WeaselServer/WeaselServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,21 @@ int WINAPI _tWinMain(HINSTANCE hInstance,
weasel::Client client;
if (client.Connect()) // try to connect to running server
{
client.ShutdownServer();
if (quit)
return 0;
int retry = 0;
while (client.Connect() && retry < 10) {
// client.ShutdownServer();
// if (quit)
// return 0;
// int retry = 0;
// while (client.Connect() && retry < 10) {
// client.ShutdownServer();
// retry++;
// Sleep(50);
// }
// if (retry >= 10)
// return 0;
if (quit) {
client.ShutdownServer();
retry++;
Sleep(50);
}
if (retry >= 10)
return 0;
return 0;
} else if (quit)
return 0;
}
Expand Down

0 comments on commit 263ca2f

Please sign in to comment.