8
Sto tentando di utilizzare SO_NOSIGPIPE in un socket tcp.SO_NOSIGPIPE non è stato rifiutato
int set = 1;
setsockopt(sockDesc, SOL_SOCKET, SO_NOSIGPIPE, (void *)&set, sizeof(int);
ma un errore è in arrivo:
error: SO_NOSIGPIPE was not declared in this scope
È stato rilevato qualche file header necessari, per usare questo. Ho cercato su Internet ma non ho trovato alcuna soluzione utile.
possibile duplicato di [Come impedire SIGPIPE (o gestirli correttamente)] (http://stackoverflow.com/questions/108183/how-to-prevent-sigpipes-or-handle-them-properly) –
Non è un'opzione standard, devi trovare un altro modo per gestire (o ignorare) il segnale. Per un elenco di tutte le opzioni standard, vedi ad es. [questo riferimento] (http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_10_16). –
Forse questo ti aiuta? http://stackoverflow.com/q/17682349/2003898 – dhein