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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user