Skip to content

Commit

Permalink
Merge pull request #229 from RI-SE/feature_readMQevenwithoutConnection
Browse files Browse the repository at this point in the history
Feature read MQ without connection to GUC
  • Loading branch information
konglobemeralt authored Mar 6, 2020
2 parents 0fec62e + 50917ff commit 61d04cb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions server/src/systemcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -1144,6 +1144,8 @@ void systemcontrol_task(TimeType * GPSTime, GSDType * GSD, LOG_LEVEL logLevel) {
nanosleep(&sleep_time, &ref_time);
}



(void)iCommClose();

LogMessage(LOG_LEVEL_INFO, "Exiting");
Expand Down Expand Up @@ -1436,6 +1438,11 @@ static I32 SystemControlInitServer(int *ClientSocket, int *ServerHandle, struct
int result = 0;
int sockFlags = 0;

enum COMMAND iCommand;
ssize_t bytesReceived = 0;
char pcRecvBuffer[SC_RECV_MESSAGE_BUFFER];


/* Init user control socket */
LogMessage(LOG_LEVEL_INFO, "Init control socket");

Expand Down Expand Up @@ -1483,6 +1490,8 @@ static I32 SystemControlInitServer(int *ClientSocket, int *ServerHandle, struct
*ClientSocket = accept(*ServerHandle, (struct sockaddr *)&cli_addr, &cli_length);
if ((*ClientSocket == -1 && errno != EAGAIN && errno != EWOULDBLOCK) || iExit)
util_error("Failed to establish connection");

bytesReceived = iCommRecv(&iCommand, pcRecvBuffer, SC_RECV_MESSAGE_BUFFER, NULL);
} while (*ClientSocket == -1);

LogMessage(LOG_LEVEL_INFO, "Connection established: %s:%i", inet_ntoa(cli_addr.sin_addr),
Expand Down

0 comments on commit 61d04cb

Please sign in to comment.