Proper detection whether SCTP is available. Do not update player names on configuration change if network client is running.
This commit is contained in:
@@ -22,6 +22,10 @@
|
||||
|
||||
#include <net/socket_startup.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
bool
|
||||
socket_startup()
|
||||
{
|
||||
@@ -33,3 +37,18 @@ socket_cleanup()
|
||||
{
|
||||
}
|
||||
|
||||
bool
|
||||
socket_has_sctp()
|
||||
{
|
||||
#ifdef IPPROTO_SCTP
|
||||
int test = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP);
|
||||
|
||||
if (test == -1)
|
||||
return false;
|
||||
close(test);
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -16,12 +16,14 @@
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
/* Socket startup/cleanup functions (required for Win32). */
|
||||
/* Socket startup/cleanup/detection functions. */
|
||||
#ifndef _SOCKET_STARTUP_H_
|
||||
#define _SOCKET_STARTUP_H_
|
||||
|
||||
bool socket_startup();
|
||||
void socket_cleanup();
|
||||
|
||||
bool socket_has_sctp();
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -66,3 +66,9 @@ socket_cleanup()
|
||||
WSACleanup();
|
||||
}
|
||||
|
||||
bool
|
||||
socket_has_sctp()
|
||||
{
|
||||
return false; /* no SCTP on Windows */
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user