Unity uClientCore > SocketListener

SocketListener Interface




onConnectSuccess(e) Occurs when a socket connection attempt succeeds.
onConnectFailure(e) Occurs when a socket connection attempt fails.
onServerKillConnect(e) Occurs when Unity closes the connection to the client.
onClientKillConnect(e) Occurs when the client closes the connection to Unity.
onXML(e) Occurs when Flash receives raw XML that is not formatted as a UPC.
onUPC(e) Occurs when Flash receives a UPC.


The SocketListener interface's methods correspond to specific socket events. Classes wishing to process socket events (such as UClient) implement this interface. An instance of an implementing class must register to receive event notifications from a specific SocketManager instance with the SocketManager.addSocketListener() method. When a socket event occurs, the SocketManager instance invokes the appropriate SocketListener method on all registered listeners. Information about the event is passed to the method in a SocketEvent object.

By default, UClient implements the SocketListener interface, providing log information for each event. To customize the behaviour of a SocketListener method in a UClient subclass, simply override the desired method.

Documentation Version