logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

socket_broadcast - set UDP socket to broadcast mode

Description

       socket_broadcast  sets  UDP  socket s to broadcast mode.  socket_send4 and socket_send6 will fail to send
       packets to the broadcast address unless socket_broadcast is called before.

       Normally socket_broadcast returns 0.

       If anything goes wrong, socket_broadcast returns -1, setting errno appropriately.

Example

         #include <libowfat/socket.h>

         int s;

         if ((s=socket_udp6())==-1)
           strerr_die2sys(111,FATAL,"unable to create UDP socket: ");
         if (socket_broadcast(s) == -1)
           strerr_die2sys(111,FATAL,"unable to set broadcast mode: ");

Name

       socket_broadcast - set UDP socket to broadcast mode

See Also

socket_send4(3), socket_send6(3)

                                                                                             socket_broadcast(3)

Syntax

#include<libowfat/socket.h>

       int socket_broadcast(int s);

return

See Also