KONRAD Frederic
Builds for 2 pipelines failed

reuse address.

Sometimes the address is not used anymore but still somehow binded.
EG: after an abort. So this allow to reuse the address.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
... ... @@ -87,6 +87,7 @@ void TCPSerial::socket_thread()
{
std::vector <unsigned char> buf;
unsigned char data;
int reuse_addr = 1;
DCOUT("init socket.");
sockfd = socket(AF_INET, SOCK_STREAM, 0);
... ... @@ -96,6 +97,13 @@ void TCPSerial::socket_thread()
exit(1);
}
if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &reuse_addr,
sizeof(int)) == -1)
{
perror("ERROR set socket option");
exit(1);
}
bzero((char *) &m_sAddr, sizeof(m_sAddr));
m_sAddr.sin_family = AF_INET;
... ...