Fixed iOS possible SIGPIPE issue.

Apparently on iOS UDP sockets can SIGPIPE (what the fuck apple?).
This commit is contained in:
irungentoo 2014-09-03 07:49:51 -04:00
parent 01203a2272
commit 38c411ec3a
No known key found for this signature in database
GPG Key ID: 10349DC9BED89E98

View File

@ -518,6 +518,12 @@ Networking_Core *new_networking(IP ip, uint16_t port)
int broadcast = 1;
setsockopt(temp->sock, SOL_SOCKET, SO_BROADCAST, (char *)&broadcast, sizeof(broadcast));
/* iOS UDP sockets are weird and apparently can SIGPIPE */
if (!set_socket_nosigpipe(temp->sock)) {
kill_networking(temp);
return NULL;
}
/* Set socket nonblocking. */
if (!set_socket_nonblock(temp->sock)) {
kill_networking(temp);