new util()
General utility functions are grouped in this util object. For convenience, this class has also been attached to the application, connection, session, and room classes.
- Source:
- easyrtc_public_obj.js, line 296
Methods
-
<static> ApplicationError(msg)
-
Custom Error Object for EasyRTC Application Errors.
Parameters:
Name Type Description msgstring Text message describing the error. - Source:
- easyrtc_public_obj.js, line 343
-
<static> ApplicationWarning(msg)
-
Custom Error Object for EasyRTC Application Warnings.
Parameters:
Name Type Description msgstring Text message describing the error. - Source:
- easyrtc_public_obj.js, line 352
-
<static> ConnectionError(msg)
-
Custom Error Object for EasyRTC C Errors.
Parameters:
Name Type Description msgstring Text message describing the error. - Source:
- easyrtc_public_obj.js, line 361
-
<static> ConnectionWarning(msg)
-
Custom Error Object for EasyRTC Connection Warnings.
Parameters:
Name Type Description msgstring Text message describing the error. - Source:
- easyrtc_public_obj.js, line 369
-
<static> deepCopy(input) → {Object}
-
Performs a deep copy of an object, returning the duplicate. Do not use on objects with circular references.
Parameters:
Name Type Description inputObject Input variable (or object) to be copied. - Source:
- easyrtc_public_obj.js, line 307
Returns:
New copy of variable.- Type
- Object
-
<static> getErrorMsg(errorCode) → {Object}
-
Returns an EasyRTC message error object for a specific error code. This is meant to be emited or returned to a websocket client.
Parameters:
Name Type Description errorCodeString EasyRTC error code associated with an error. - Source:
- easyrtc_public_obj.js, line 396
Returns:
EasyRTC message error object for the specific error code.- Type
- Object
-
<static> getErrorText(errorCode) → {string}
-
Returns human readable text for a given error code. If an unknown error code is provided, a null value will be returned.
Parameters:
Name Type Description errorCodeString EasyRTC error code associated with an error. - Source:
- easyrtc_public_obj.js, line 421
Returns:
Human readable error string- Type
- string
-
<static> isError(Will) → {Boolean}
-
Determines if an Error object is an instance of ApplicationError, ConnectionError, or ServerError. If it is, it will return true.
Parameters:
Name Type Description Will* | Error accept any value, but will only return true for appropriate error objects. - Source:
- easyrtc_public_obj.js, line 324
Returns:
- Type
- Boolean
-
<static> isValidIncomingMessage(type, msg, appObj, callback)
-
Checks an incoming EasyRTC message to determine if it is syntactically valid.
Parameters:
Name Type Argument Description typestring The Socket.IO message type. Expected values are (easyrtcAuth|easyrtcCmd|easyrtcMsg) msgObject Message object which contains the full message from a client; this can include the standard msgType and msgData fields. appObjObject <nullable>
EasyRTC application object. Contains methods used for identifying and managing an application. callbackfunction(Error, {boolean}, {string}) Callback with error, a boolean of whether message if valid, and a string indicating the error code if the message is invalid. - Source:
- easyrtc_public_obj.js, line 559
-
<static> isWarning(Will) → {Boolean}
-
Determines if an Error object is an instance of ApplicationWarning, ConnectionWarning, or ServerWarning. If it is, it will return true.
Parameters:
Name Type Description Will* | Error accept any value, but will only return true for appropriate error objects. - Source:
- easyrtc_public_obj.js, line 334
Returns:
- Type
- Boolean
-
<static> log(level, logText, logFields)
-
General logging function which emits a log event so long as the log level has a severity equal or greater than e.option.logLevel
Parameters:
Name Type Argument Description levelstring Log severity level. Can be ("debug"|"info"|"warning"|"error") logTextstring Text for log. logFields* <optional>
<nullable>
Simple JSON object which contains extra fields to be logged. - Source:
- easyrtc_public_obj.js, line 461
-
<static> logDebug(logText, logFields)
-
Convenience function for logging "debug" level items.
Parameters:
Name Type Argument Description logTextstring Text for log. logFields* <optional>
<nullable>
Simple JSON object which contains extra fields to be logged. - Source:
- easyrtc_public_obj.js, line 484
-
<static> logError(logText, logFields)
-
Convenience function for logging "error" level items.
Parameters:
Name Type Argument Description logTextstring Text for log. logFields* <optional>
<nullable>
Simple JSON object which contains extra fields to be logged. - Source:
- easyrtc_public_obj.js, line 517
-
<static> logInfo(logText, logFields)
-
Convenience function for logging "info" level items.
Parameters:
Name Type Argument Description logTextstring Text for log. logFields* <optional>
<nullable>
Simple JSON object which contains extra fields to be logged. - Source:
- easyrtc_public_obj.js, line 495
-
<static> logWarning(logText, logFields)
-
Convenience function for logging "warning" level items.
Parameters:
Name Type Argument Description logTextstring Text for log. logFields* <optional>
<nullable>
Simple JSON object which contains extra fields to be logged. - Source:
- easyrtc_public_obj.js, line 506
-
<static> nextToNowhere(input)
-
An empty dummy function, which is designed to be used as a default callback in functions when none has been provided.
Parameters:
Name Type Description inputObject Input variable (or object) to be copied. - Source:
- easyrtc_public_obj.js, line 315
-
<static> sendSessionCookie(req, res)
-
Will attempt to deliver an EasyRTC sessionid via a cookie. Requires that session management be enabled from within Express.
Parameters:
Name Type Description reqObject Http request object resObject Http result object - Source:
- easyrtc_public_obj.js, line 901
-
<static> ServerError(msg)
-
Custom Error Object for EasyRTC Server Errors.
Parameters:
Name Type Description msgstring Text message describing the error. - Source:
- easyrtc_public_obj.js, line 378
-
<static> ServerWarning(msg)
-
Custom Error Object for EasyRTC Server Warnings.
Parameters:
Name Type Description msgstring Text message describing the error. - Source:
- easyrtc_public_obj.js, line 387
-
<static> updateCheck()
-
Checks with EasyRTC site for latest version. Writes to the log if a version can be found. If connection cannot be established than no error will be shown.
- Source:
- easyrtc_public_obj.js, line 525