Socket

Socket A Socket is the fundamental class for interacting with browser clients. A Socket belongs to a certain Namespace (by default /) and uses an underlying Client to communicate.

Manager#reconnectionAttempts

Manager#reconnectionAttempts(v:Boolean):Manager Sets the reconnectionAttempts option, or returns it if no parameters are passed.

Server#sockets

Server#sockets:Namespace The default (/) namespace.

IO#Socket

IO#Socket Reference to the Socket constructor.

Server#listen

Server#listen Synonym of Server#attach.

Socket#emit

Socket#emit(name:String[, …]):Socket Emits an event to the socket identified by the string name. Any other parameters can be included. All datastructures are supported, including Buffer. JavaScript functions can’t be serialized/deserialized. var io = require('socket.io')(); io.on('connection', function(socket){ socket.emit('an event', { some: 'data' }); });

Namespace

Namespace Represents a pool of sockets connected under a given scope identified by a pathname (eg: /chat). By default the client always connects to /. Events connection / connect. Fired upon a connection. Parameters: Socket the incoming socket.

IO#protocol

IO#protocol Socket.io protocol revision number this client works with.

Client

Client The Client class represents an incoming transport (engine.io) connection. A Client can be associated with many multiplexed Socket that belong to different Namespaces.

Namespace#connected

Namespace#connected:Object Hash of Socket objects that are connected to this namespace indexed by id.