Class Index | File Index

Classes


Class VENISON.NETWORK.NetworkManager

The manager to handle real-time networking.
Defined in: venison_engine.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Method Summary
Method Attributes Method Name and Description
 
Register a listener to be notified of network events.
 
fnConnect(iPort)
Connect to socket.io on the node.js (http://nodejs.org) server running on the server machine, on the specified port.
 
Disconnect from socket.io on the node.js (http://nodejs.org) server running on the server machine.
 
Function to remove a previously added network listener.
 
fnSendMessage(iMessage)
Send a message to socket.io on the node.js (http://nodejs.org) server running on the server machine.
Class Detail
VENISON.NETWORK.NetworkManager()
Method Detail
fnAddNetworkListener(iListener)
Register a listener to be notified of network events.
//NOTE: The following code registers an anonymous listener, that can not later be removed.
//In order to be able to remove a listener, keep a reference to it and then pass that reference to VENISON.NETWORK.NetworkManager.fnRemoveNetworkListener.
VENISON.NETWORK.NetworkManager.fnAddNetworkListener({
		fnMessageReceived: function (iMessage) {
			//Do something
		},
		fnMessageSent: function (iMessage) {
			//Do something
		},
		fnConnectionOpened: function () {
			//Do something
		},
		fnConnectionClosed: function () {
			//Do something
		},
		fnExceptionCaught: function (iException) {
			//Do something
		}
});
Parameters:
{Object} iListener
An object with the methods fnMessageReceived(iMessage), fnMessageSent(iMessage), fnConnectionOpened(), fnConnectionClosed() and fnExceptionCaught().

fnConnect(iPort)
Connect to socket.io on the node.js (http://nodejs.org) server running on the server machine, on the specified port.
Parameters:
{Number} iPort
The port number on which the node.js server is listening.
See:
VENISON.NETWORK.NetworkManager#fnDisconnect

fnDisconnect()
Disconnect from socket.io on the node.js (http://nodejs.org) server running on the server machine.
See:
VENISON.NETWORK.NetworkManager#fnConnect

fnRemoveNetworkListener(iListener)
Function to remove a previously added network listener.
Parameters:
{Object} iListener
The listener to be removed.
See:
VENISON.NETWORK.NetworkManager#fnAddNetworkListener

fnSendMessage(iMessage)
Send a message to socket.io on the node.js (http://nodejs.org) server running on the server machine.
Parameters:
{Object} iMessage
The message to send (could be any JavaScript object).
See:
VENISON.NETWORK.NetworkManager#fnConnect
VENISON.NETWORK.NetworkManager#fnDisconnect

Documentation generated by JsDoc Toolkit 2.4.0 on Thu May 05 2011 18:47:29 GMT+0200 (CEST)