| 472 | } |
| 473 | |
| 474 | void initSettings() { |
| 475 | Exception ex; |
| 476 | #if defined(__MACH__) && defined(__APPLE__) || defined(__FreeBSD__) |
| 477 | // SIGPIPE sends a signal that if unhandled (which is the default) |
| 478 | // will crash the process. |
| 479 | // |
| 480 | // In order to have sockets behave the same across platforms, it is |
| 481 | // best to just ignore SIGPIPE all together. |
| 482 | |
| 483 | setOption(ex,SOL_SOCKET, SO_NOSIGPIPE, 1); |
| 484 | #endif |
| 485 | if (type==Socket::STREAM) |
| 486 | setNoDelay(ex,true); // to avoid the nagle algorhytme, ignore error if not possible |
| 487 | } |
| 488 | |
| 489 | template<typename Type> |
| 490 | Type& getOption(Exception& ex, int level, int option, Type& value) const { |
nothing calls this directly
no outgoing calls
no test coverage detected