Namespace jsf.push
jsf.push
Defined in: jsf.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
<static> |
jsf.push.close(channel)
Close the web socket on the given channel.
|
<inner> |
getBaseURL(url)
|
<inner> |
getSocket(channelToken)
Get socket associated with given channelToken.
|
<static> |
jsf.push.init(onopen, onmessage, onclose, autoconnect, onmessage, onclose, behaviorScripts, autoconnect)
|
<static> |
jsf.push.open(channel)
Open the web socket on the given channel.
|
Method Detail
<static>
jsf.push.close(channel)
Close the web socket on the given channel.
- Parameters:
- {string} channel
- The name of the web socket channel.
- Throws:
- {Error}
- When channel is unknown.
<inner>
getBaseURL(url)
- Parameters:
- url
<inner>
{Socket}
getSocket(channelToken)
Get socket associated with given channelToken.
- Parameters:
- {string} channelToken
- The name of the web socket channelToken.
- Throws:
- {Error}
- When channelToken is unknown, you may need to initialize
it first via
init()
function.
- Returns:
- {Socket} Socket associated with given channelToken.
<static>
jsf.push.init(onopen, onmessage, onclose, autoconnect, onmessage, onclose, behaviorScripts, autoconnect)
- Parameters:
- {function} onopen
- The function to be invoked when the web socket is opened.
- {function} onmessage
- The function to be invoked when a message is received.
- {function} onclose
- The function to be invoked when the web socket is closed.
- {boolean} autoconnect
- Whether or not to immediately open the socket. Defaults to
false
. - onmessage
- onclose
- behaviorScripts
- autoconnect
<static>
jsf.push.open(channel)
Open the web socket on the given channel.
- Parameters:
- {string} channel
- The name of the web socket channel.
- Throws:
- {Error}
- When channel is unknown.