Wrote server under Linux. I start, connect to it through the browser. When I close the tab, the server drops to the next line.
if (send(s, &message[0], message.length(), 0) == SOCKET_ERROR) { throw std::string("Unable to send() string: ") + toString(errno); } The exception is not caught.
EPIPE, or it may send a signal. - KoVadimsend()MSG_NOSIGNALflag tosend()in Linux. Either block this signal (sigprocmask () / sighold ()) or intercept (sigaction () / signal ()) or you can ignore (sigaction () / signal ()). Do you have SOCKET_ERROR -1? - avp