0
void main()
{

    HANDLE h1,h2,h3;
    uint8 data;

double Task2ms_Raster, Task10ms_Raster, Task100ms_Raster ;


CreateSocket();

XCP_FN_TYPE Xcp_Initialize( );



    while(1)
        {

            data = recv(fd, recv_data, 99, 0);
            if (data == SOCKET_ERROR) {
     printf("recv failed with error %d\n", WSAGetLastError());
     } 
            else
            {
             pChunkData = &recv_data;
            chunkLen = sizeof(pChunkData);
            XcpIp_RxCallback ((uint16) chunkLen, (char*) pChunkData, (uint16) port);

            }
    }




 h1=TimerTask(2,TASK1,&Task2ms_Raster);
 h2=TimerTask(10,TASK2,&Task10ms_Raster);
 h3=TimerTask(100,TASK3,&Task100ms_Raster);

  XCP_FN_TYPE XcpIp_OnTcpCxnClosed( port );

}

I have created the server socket and recieving data from the client via the ip address and the port number. I have to run the timer task in parallel with the recieve data from the socket.The function definition of create scoket and TimerTask functionality is not shown. So could anyone please help me how to run the timer task parallel to it ??

Jens Gustedt
  • 76,821
  • 6
  • 102
  • 177
user3189297
  • 65
  • 1
  • 10

0 Answers0