Skip to content

Latest commit

 

History

History
106 lines (76 loc) · 4.53 KB

SERVER.md

File metadata and controls

106 lines (76 loc) · 4.53 KB

DirectStreamAccess : DirectStreamAccess

Implementation for the SERVER side. Available as Meteor.directStream singleton.

Kind: global class
Extends: DirectStreamAccessCommon
Category: SERVER

meteor.directStream.send(message, sessionId)

Sends a message to a specified Meteor session id.

Kind: instance method of DirectStreamAccess
Throws:

  • Error When session id is not found.
Param Type Description
message string Message to send to the client.
sessionId string Meteor's internal session id.

meteor.directStream.broadcast(message)

Broadcasts the message to all clients.

Kind: instance method of DirectStreamAccess

Param Type Description
message string Message to send to all connected clients.

meteor.directStream.onMessage(messageHandler)

Registers a message handler, which will be called to process every incoming message on the socket.

Kind: instance method of DirectStreamAccess

Param Type Description
messageHandler messageHandler Function to process the incoming messages.

meteor.directStream.preventCallingMeteorHandler()

Prevents calling the original meteor message handler. Makes the message invisible for Meteor. Since any message handler is bound to this class, inside the message handler it is just called with this.preventCallingMeteorHandler().

Kind: instance method of DirectStreamAccess

meteor.directStream.stopProcessingHandlers()

Stops processing any other message handlers. Since any message handler is bound to this class, inside the message handler it is just called with this.stopProcessingHandlers().

Kind: instance method of DirectStreamAccess

meteor.directStream._processMessage(message, [sessionId], [userId], [connectionId], [connection])

Passes the received message to registered handlers.

Kind: instance method of DirectStreamAccess
Access: protected

Param Type Description
message string Raw message received on the socket.
[sessionId] string Meteor's internal session id.
[userId] string User id if available.
[connectionId] Symbol Id of the additional DDP connection.
[connection] Object Reference to DDP connection object.

Meteor.directStream~messageHandler : function

Callback passed to the registerMessageHandler that should process the incoming messages.

Kind: inner typedef of DirectStreamAccess

Param Type Description
message string Message received on the socket.
[sessionId] string Meteor's internal session id.
[userId] string User id if available.
[connectionId] Symbol Id of the additional DDP connection.
[connection] Object Reference to DDP connection object.