AcessNative - Set SO_REUSEADDR
authorJohn Hodge (sonata) <[email protected]>
Fri, 26 Dec 2014 23:29:23 +0000 (07:29 +0800)
committerJohn Hodge (sonata) <[email protected]>
Fri, 26 Dec 2014 23:29:23 +0000 (07:29 +0800)
AcessNative/acesskernel_src/server.c

index 8de8ad3..4dd964c 100644 (file)
@@ -228,6 +228,13 @@ int SyscallServer(void)
        server.sin_port = htons(SERVER_PORT);
        server.sin_addr.s_addr = htonl(INADDR_ANY);
        
+       #if USE_TCP
+       {
+               int val = 1;
+               setsockopt(gSocket, SOL_SOCKET, SO_REUSEADDR, &val, sizeof val);
+       }
+       #endif
+       
        // Bind
        if( bind(gSocket, (struct sockaddr *)&server, sizeof(struct sockaddr_in)) == -1 )
        {

UCC git Repository :: git.ucc.asn.au