mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Fixed iOS possible SIGPIPE issue.
Apparently on iOS UDP sockets can SIGPIPE (what the fuck apple?).
This commit is contained in:
parent
01203a2272
commit
38c411ec3a
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user