12 years ago.

Continuous updates

Hi, I am sending out regular position updates (once a second) to a server using the TCP example in your demo, do I have to close the socket and re-open it every time? It didn't work until I did this, but now it sometimes the socket won't open and I miss a number of samples.

I run this routine every time I get a valid GPS update:

socket = mdm.socketSocket(MDMParser::IPPROTO_TCP);

if (socket >= 0)

{

mdm.socketSetBlocking(socket, 10000);

if (mdm.socketConnect(socket, host, port))

{

ret = mdm.socketSend(socket, link, n);

printf(link);

mdm.socketClose(socket);

}

mdm.socketFree(socket);

}

but 'socket' returns -1 for a number of samples, so they don't get transmitted, then it starts working fine again.

Question relating to:

Be the first to answer this question.