 <p>Unwind has it right, except you should use 'sendto'</p> <p>Here is an example, that assumes you already have a socket. It was taken from <a href="http://www.blushingpenguin.com/svn/vendor/clamav/0.94.2/clamav-milter/clamav-milter.c" rel="nofollow noreferrer">clamav</a></p> <pre><code>static void broadcast(const char *mess) { struct sockaddr_in s; if(broadcastSock &lt; 0) return; memset(&amp;s, '\0', sizeof(struct sockaddr_in)); s.sin_family = AF_INET; s.sin_port = (in_port_t)htons(tcpSocket ? tcpSocket : 3310); s.sin_addr.s_addr = htonl(INADDR_BROADCAST); cli_dbgmsg("broadcast %s to %d\n", mess, broadcastSock); if(sendto(broadcastSock, mess, strlen(mess), 0, (struct sockaddr *)&amp;s, sizeof(struct sockaddr_in)) &lt; 0) perror("sendto"); } </code></pre>