docs: function Socket(node) {
  
          // ## Public properties
  
          /**
           * ### Socket.buffer
           *
           * Buffer of queued incoming messages
           *
           * @api private
           */
          this.buffer = [];
  
          /**
           * ### Socket.outBuffer
           *
           * Buffer of queued outgoing messages
           *
           * TODO: implement!
           *
           * @api private
           */
          // this.outBuffer = [];
  
          /**
           * ### Socket.session
           *
           * The session id shared with the server
           *
           * This property is initialized only when a game starts
           *
           */
          this.session = null;
  
          /**
           * ### Socket.userOptions
           *
           * Contains the options that will be passed to the `connect` method
           *
           * The property is set by `node.setup.socket`.
           * Passing options to the `connect` method will overwrite this property.
           *
           * @see node.setup
           * @see Socket.connect
           */
          this.userOptions = {};
  
          /**
           * ### Socket.socket
           *
           * The actual socket object (e.g. SocketDirect, or SocketIo)
           */
          this.socket = null;
  
          /**
           * ### Socket.connected
           *
           * Socket connection established
           *
           * For realiably checking whether the connection is established
           * use `Socket.isConnected()`.
           *
           * @see Socket.connecting
           * @see Socket.isConnected
           * @see Socket.onConnect
           * @see Socket.onDisconnect
           */
          this.connected = false;
  
          /**
           * ### Socket.connecting
           *
           * Socket connection being established
           *
           * TODO see whether we should merge connected / connecting
           * in one variable with socket states.
           *
           * @see Socket.connected
           * @see Socket.isConnected
           * @see Socket.onConnect
           * @see Socket.onDisconnect
           */
          this.connecting = false;
  
  
           /**
           * ### Socket.reconnecting
           *
           * Flags that a reconnection is in progress
           *
           * This is useful when `Socket.reconnect()` triggers a disconnection
           *
           * @see Socket.reconnect
           */
          this.reconnecting = false;
  
           /**
           * ### Socket.connectingTimeout
           *
           * Timeout to cancel the connecting procedure
           *
           * @see Socket.connecting
           * @see Socket.connect
           */
          this.connectingTimeout = null;
  
           /**
           * ### Socket.connectingTimeoutMs
           *
           * Number of milliseconds for the connecting timeout
           *
           * Default: 10000 (10 seconds)
           *
           * @see Socket.connecting
           * @see Socket.connect
           */
          this.connectingTimeoutMs = 10000;
  
          /**
           * ### Socket.url
           *
           * The full url to which the socket is connected
           *
           * This is set when a new connection attempt is started.
           *
           * It might not be meaningful for all types of sockets. For example,
           * in case of SocketDirect, it is not an real url.
           *
           * @see Socket.connect
           */
          this.url = null;
  
          /**
           * ### Socket.channelName
           *
           * The name of the channel to which the socket is connected
           *
           * This is set upon a successful connection.
           *
           * @see Socket.startSession
           */
          this.channelName = null;
  
          /**
           * ### Socket.type
           *
           * The type of socket used
           */
          this.type = null;
  
          /**
           * ### Socket.emitOutMsg
           *
           * If TRUE, outgoing messages will be emitted upon sending
           *
           * This allows, for example, to modify all outgoing messages.
           */
          this.emitOutMsg = false;
  
          /**
           * ### Socket.antiSpoofing
           *
           * If TRUE, sid is added to each message
           *
           * This setting is sent over by server.
           */
          this.antiSpoofing = null;
  
          // Experimental Journal.
          // TODO: check if we need it.
          this.journalOn = false;
  
          // Experimental
          this.journal = new parent.NDDB({
              update: {
                  indexes: true
              }
          });
          this.journal.comparator('stage', function(o1, o2) {
              return parent.GameStage.compare(o1.stage, o2.stage);
          });
  
          if (!this.journal.player) {
              this.journal.hash('to', function(gb) {
                  return gb.to;
              });
          }
          if (!this.journal.stage) {
              this.journal.hash('stage', function(gb) {
                  if (gb.stage) {
                      return parent.GameStage.toHash(gb.stage, 'S.s.r');
                  }
              });
          }
          // End Experimental Code.
  
          /**
           * ### Socket.node
           *
           * Reference to the node object.
           */
          this.node = node;
      }