Commit 0009cbef authored by Andreas Schmidt's avatar Andreas Schmidt

Add SO_BROADCAST option to sockets.

parent 7e08d77b
Pipeline #680 failed with stage
in 42 seconds
......@@ -40,8 +40,12 @@ PrrtSocket *PrrtSocket_create(const bool is_sender)
sock_ptr->dataPacketStore = PrrtDataPacketStore_create();
check(sock_ptr->dataSocketFd = socket(AF_INET, SOCK_DGRAM, 0), "Cannot create data socket.")
int enabled = 1;
check(sock_ptr->dataSocketFd = socket(AF_INET, SOCK_DGRAM, 0), "Cannot create data socket.");
check(setsockopt(sock_ptr->dataSocketFd, SOL_SOCKET, SO_BROADCAST, &enabled, sizeof(enabled)), "Socket option set failed.");
check(sock_ptr->feedbackSocketFd = socket(AF_INET, SOCK_DGRAM, 0), "Cannot create feedback socket.");
check(setsockopt(sock_ptr->feedbackSocketFd, SOL_SOCKET, SO_BROADCAST, &enabled, sizeof(enabled)), "Socket option set failed.");
pthread_mutexattr_t attr;
check(pthread_mutexattr_init(&attr) == 0, "Mutex attr init failed.");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment