function TcpServer(addr, port, options) {
    this.addr = addr;
    this.port = port;
    this.maxConnections = typeof(options) != 'undefined'
        && options.maxConnections || DEFAULT_MAX_CONNECTIONS;

    this._onAccept = this._onAccept.bind(this);
    this._onAcceptError = this._onAcceptError.bind(this);

    // Callback functions.
    this.callbacks = {
      listen: null,    // Called when socket is connected.
      connect: null,    // Called when socket is connected.
      disconnect: null, // Called when socket is disconnected.
      recv: null,       // Called when client receives data from server.
      sent: null        // Called when client sends data to server.
    };

    // Sockets open
    this.openSockets=[];

    // server socket (one server connection, accepts and opens one socket per client)
    this.serverSocketId = null;

    log('initialized tcp server, not listening yet');
  }
Creates an instance of the client

@param {String} host The remote host to connect to
@param {Number} port The port to connect to at the remote host