Tuesday, 15 January 2013

c - SO_NOSIGPIPE was not decleared -



c - SO_NOSIGPIPE was not decleared -

i trying utilize so_nosigpipe in tcp socket.

int set = 1; setsockopt(sockdesc, sol_socket, so_nosigpipe, (void *)&set, sizeof(int);

but error coming:

error: so_nosigpipe not declared in scope

is there header files required, utilize that. have searched on net didn't useful solution.

there no so_nosigpipe in linux (nor other systems). can instead utilize msg_nosignal flag when calling send(), or utilize signal(sigpipe, sig_ign) create entire application ignore sigpipe.

c sockets tcp

No comments:

Post a Comment