This commit is contained in:
2026-03-18 16:16:14 -05:00
parent 192e2f69ee
commit 3810db7ac8

View File

@@ -49,9 +49,11 @@ pollForSever(void *args)
}*/ }*/
// cout << "Server: " << msg << endl; // cout << "Server: " << msg << endl;
// printf("Server: %s\n"); // printf("Server: %s\n");
writeToFile(logFileName, msg); writeToFile(logFileName, msg);
if (linesInFile(logFileName) > LOG_LENGTH) if (linesInFile(logFileName) > LOG_LENGTH)
linePos++; linePos++;
displayFile(logFileName, linePos, LOG_LENGTH); displayFile(logFileName, linePos, LOG_LENGTH);
} }
} }
@@ -77,8 +79,10 @@ setupClient()
// try to connect... // try to connect...
int status = int status =
connect(clientSocketDescriptor, (sockaddr *)&sendSockAddr, sizeof(sendSockAddr)); connect(clientSocketDescriptor, (sockaddr *)&sendSockAddr, sizeof(sendSockAddr));
if (status < 0) if (status < 0)
writeToFile(logFileName, "Error connecting to socket!"); writeToFile(logFileName, "Error connecting to socket!");
writeToFile(logFileName, "Connected to the server!"); writeToFile(logFileName, "Connected to the server!");
int bytesRead, bytesWritten = 0; int bytesRead, bytesWritten = 0;
struct timeval start1, end1; struct timeval start1, end1;