Skip to content

Instantly share code, notes, and snippets.

@Mooophy
Created August 17, 2015 09:41
Show Gist options
  • Select an option

  • Save Mooophy/8259186b61d325f50374 to your computer and use it in GitHub Desktop.

Select an option

Save Mooophy/8259186b61d325f50374 to your computer and use it in GitHub Desktop.
auto optval = 1;
setsockopt(soc, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof optval);
auto bind_result = bind(soc, (struct sockaddr *)&my_addr, sizeof(my_addr));
if (bind_result != 0)
printf("%d\n", errno);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment