UNPKG

diffusion

Version:

Diffusion JavaScript client

124 lines (120 loc) 2.53 kB
var _interface = require('util/interface')._interface; /** * Lightweight summary of a client session. * * @class ClientSummary * @property {String} principal - the name of the principal associated with the session * @property {diffusion.clients.ClientType} clientType - the type of the client * @property {diffusion.clients.TransportType} transportType - the transport type */ module.exports = _interface('ClientSummary', [ 'principal', 'clientType', 'transportType' ]); /** * Enum containing possible client types. * * @readonly * @enum * @memberOf diffusion.clients * @alias ClientType */ module.exports.ClientType = { /** * JavaScript client */ JAVASCRIPT_BROWSER : 0, /** * JavaScript client, using a Flash transport bridge */ JAVASCRIPT_FLASH : 1, /** * JavaScript client, using a Silverlight transport bridge */ JAVASCRIPT_SILVERLIGHT : 2, /** * Android client */ ANDROID : 3, /** * iOS client */ IOS : 4, /** * J2ME client. Includes Blackberry clients */ J2ME : 5, /** * Flash client */ FLASH : 6, /** * Silverlight client */ SILVERLIGHT : 7, /** * Java client */ JAVA : 8, /** * .NET client */ DOTNET : 9, /** * C */ C : 10, /** * Internal Diffusion client */ INTERNAL : 11, /** * Client type is not known to the local session, possibly because the remote client is using a different version * of Diffusion */ OTHER : 12 }; /** * Enum containing possible Transport types. * * @readonly * @enum * @memberOf diffusion.clients * @alias TransportType */ module.exports.TransportType = { /** * WebSocket protocol */ WEBSOCKET : 0, /** * HTTP long polling transport */ HTTP_LONG_POLL : 1, /** * HTTP long poll, via HTML iFrame elements */ IFRAME_LONG_POLL : 2, /** * HTTP 1.1 chunked transfer via HTML iFrame elements */ IFRAME_STREAMING : 3, /** * Diffusion protocol based on TCP sockets */ DPT : 4, /** * Diffusion protocol based on HTTP 1.1 chunked transfer */ HTTPC : 5, /** * Diffusion protocol based on HTTP 1.1 chunked transfer */ HTTPC_DUPLEX : 6, /** * Transport type is not known to the local session, possible because the remote client is using a different version * of Diffusion */ OTHER : 7 };