So under windows -where SO_REUSEADDR is defined- it systematically reuses the socket, i think this is not what i would like as i would like that only one process is able to listen on that port.
Maybe do i miss something, but shoudn't that be implemented in a different way than using #define ?
Cheers,
Laurent
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have a "problem" with the tcpthread demo example.
The test just run fine if i just run it 1 time.
If i run it 2 times, i would have expected that a "bind" socket exception would be thrown as the port 4096 is already busy.
In the constructor of the TCPSocket, i see :
#ifdef SO_REUSEADDR
int opt = 1;
setsockopt(so, SOL_SOCKET, SO_REUSEADDR, (char *)&opt, (socklen_t)sizeof(opt));
#endif
So under windows -where SO_REUSEADDR is defined- it systematically reuses the socket, i think this is not what i would like as i would like that only one process is able to listen on that port.
Maybe do i miss something, but shoudn't that be implemented in a different way than using #define ?
Cheers,
Laurent