File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -440,18 +440,18 @@ void tcpServerUpdate()
440
440
// Determine if the client data structure is in use
441
441
if (!(tcpServerClientConnected & (1 << index )))
442
442
{
443
- NetworkClient client;
443
+ if (tcpServerClient[index ] == nullptr )
444
+ tcpServerClient[index ] = new NetworkClient;
444
445
445
446
// Data structure not in use
446
447
// Check for another TCP server client
447
- client = tcpServer->accept ();
448
+ *tcpServerClient[ index ] = tcpServer->accept ();
448
449
449
- // Done if no TCP server client found
450
- if (!client )
450
+ // Exit if no TCP server client found
451
+ if (! *tcpServerClient[ index ] )
451
452
break ;
452
453
453
454
// Start processing the new TCP server client connection
454
- tcpServerClient[index ] = new NetworkClient;
455
455
tcpServerClientIpAddress[index ] = tcpServerClient[index ]->remoteIP ();
456
456
tcpServerClientConnected = tcpServerClientConnected | (1 << index );
457
457
tcpServerClientDataSent = tcpServerClientDataSent | (1 << index );
You can’t perform that action at this time.
0 commit comments