Proper detection whether SCTP is available. Do not update player names on configuration change if network client is running.

This commit is contained in:
lotodore
2007-06-04 16:19:11 +00:00
parent ffbe8ac924
commit b9ccba6ed4
8 changed files with 37 additions and 15 deletions
+19
View File
@@ -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
}
+3 -1
View File
@@ -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
+6
View File
@@ -66,3 +66,9 @@ socket_cleanup()
WSACleanup();
}
bool
socket_has_sctp()
{
return false; /* no SCTP on Windows */
}