Skip to content

Commit

Permalink
Temporary crash fix, TODO: reopen socket when SIGPIPE
Browse files Browse the repository at this point in the history
  • Loading branch information
ngocdh committed Jun 7, 2021
1 parent cb53bea commit 114460e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ void CSocket::Init ( const quint16 iPortNumber, const quint16 iQosNumber, const
const char tos = (char) iQosNumber; // Quality of Service
setsockopt ( UdpSocket, IPPROTO_IP, IP_TOS, &tos, sizeof ( tos ) );

#ifdef Q_OS_IOS
//ignore the broken pipe signal to avoid crash (iOS)
int valueone = 1;
setsockopt(UdpSocket, SOL_SOCKET, SO_NOSIGPIPE, &valueone, sizeof(valueone));
#endif

// allocate memory for network receive and send buffer in samples
vecbyRecBuf.Init ( MAX_SIZE_BYTES_NETW_BUF );

Expand Down

0 comments on commit 114460e

Please sign in to comment.