Skip to content

Instantly share code, notes, and snippets.

@laheadle
Created January 2, 2013 02:53
Show Gist options
  • Save laheadle/4431741 to your computer and use it in GitHub Desktop.
Save laheadle/4431741 to your computer and use it in GitHub Desktop.
int peer_broadcast(tpeer peerIn, char* msg, unsigned int size)
{
speer* p = mkspeer(peerIn);
int val = sendto(p->socket, msg, size, 0,
(struct sockaddr *)&p->addr, sizeof p->addr);
if (val == -1) {
char buf[32];
sprintf(buf, "broadcast %d", WSAGetLastError());
ulog(buf);
}
return val;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment