Other Parts Discussed in Thread: MSP432E401Y
Hi,
We are running a HTTP server on MSP432E401Y microcontroller. Can we have persistent connection established with a client?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
We are running a HTTP server on MSP432E401Y microcontroller. Can we have persistent connection established with a client?
Hi,
Not an expert for this question but I think the TCP/IP on the server side will close the connection after the data has been sent. One thing I can think of is to use keep-alive.
I think setsockopt() is a BSD function to set socket options. https://pubs.opengroup.org/onlinepubs/000095399/functions/setsockopt.html
An example could be as follows.
/*
* Setup socket option as to enable keeping connections alive
*/
optval = 1;
if (setsockopt(server, SOL_SOCKET, SO_KEEPALIVE, &optval, optlen) < 0) {
System_printf("Error: setsockopt failed\n");
goto shutdown;
}