Skip to content

Instantly share code, notes, and snippets.

@kkumar-fk
Created July 23, 2019 04:04
Show Gist options
  • Save kkumar-fk/6e5af42620cbae8307c307d5c4b2b805 to your computer and use it in GitHub Desktop.
Save kkumar-fk/6e5af42620cbae8307c307d5c4b2b805 to your computer and use it in GitHub Desktop.
const struct linger opt = { .l_onoff = 1, .l_linger = 0 };
setsockopt(fd, SOL_SOCKET, SO_LINGER, &opt, sizeof opt);
close(fd);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment