(svn r20935) -Codechange: only let the server side use a pool of connected sockets

This commit is contained in:
rubidium
2010-10-15 19:58:56 +00:00
parent bda26d03b5
commit 9858d699a3
8 changed files with 39 additions and 36 deletions

View File

@@ -31,6 +31,7 @@
#include "../window_func.h"
#include "../roadveh.h"
#include "../order_backup.h"
#include "../core/pool_func.hpp"
#include "../rev.h"
#include "table/strings.h"
@@ -41,6 +42,13 @@ DECLARE_POSTFIX_INCREMENT(ClientID)
/** The identifier counter for new clients (is never decreased) */
static ClientID _network_client_id = CLIENT_ID_FIRST;
/** Make very sure the preconditions given in network_type.h are actually followed */
assert_compile(MAX_CLIENT_SLOTS > MAX_CLIENTS);
assert_compile(NetworkClientSocketPool::MAX_SIZE == MAX_CLIENT_SLOTS);
NetworkClientSocketPool _networkclientsocket_pool("NetworkClientSocket");
INSTANTIATE_POOL_METHODS(NetworkClientSocket)
/**
* Create a new socket for the server side of the game connection.
* @param s The socket to connect with.