Unity uClientCore > SocketManager

SocketManager Class

Extends

XMLSocket

Constructor

SocketManager(host, port)

Arguments

host
The string name of the domain on which Unity is running. For example, "moock.org" or "192.233.42.1". Use localhost to the local machine (i.e., the machine on which the Flash movie is running).
port
The integer port number on which Unity is running. Must be greater than 1023. By default, Unity uses 9100.

Methods

addSocketListener(l) Registers an object to recieve SocketListener events.
doConnect() Connects to Unity at the current host/port.
getHost Returns the host on which the socket connection will be opened or has been opened.
getPort Returns the port on which the socket connection will be opened or has been opened.
killConnect() Closes the connection to Unity.
removeSocketListener(l) Cancels SocketListener event notifications for an object.
setServer(host, port) Assigns the host and port to use with doConnect().

Description

The SocketManager class is used internally by UClient to make an XMLSocket connection to Unity. Developers should normally not need to use SocketManager directly, but instead should rely on UClient.connect(). To respond to socket events broadcast by SocketManager, classes should implement SocketListener.

Documentation Version

1.0.0