Unity uClientCore > SocketManager

SocketManager Class




SocketManager(host, port)


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


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().


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