Skip to content

Commit

Permalink
Assign incoming TCP connection to the tcpServerClient array.
Browse files Browse the repository at this point in the history
Fixes #506
  • Loading branch information
nseidle committed Dec 19, 2024
1 parent ac4ba63 commit da7d114
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Firmware/RTK_Everywhere/TcpServer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -440,18 +440,18 @@ void tcpServerUpdate()
// Determine if the client data structure is in use
if (!(tcpServerClientConnected & (1 << index)))
{
NetworkClient client;
if(tcpServerClient[index] == nullptr)
tcpServerClient[index] = new NetworkClient;

// Data structure not in use
// Check for another TCP server client
client = tcpServer->accept();
*tcpServerClient[index] = tcpServer->accept();

// Done if no TCP server client found
if (!client)
// Exit if no TCP server client found
if (! *tcpServerClient[index])
break;

// Start processing the new TCP server client connection
tcpServerClient[index] = new NetworkClient;
tcpServerClientIpAddress[index] = tcpServerClient[index]->remoteIP();
tcpServerClientConnected = tcpServerClientConnected | (1 << index);
tcpServerClientDataSent = tcpServerClientDataSent | (1 << index);
Expand Down

0 comments on commit da7d114

Please sign in to comment.