Search in sources :

Example 1 with IConnectionEventListener

use of com.neuronrobotics.sdk.common.IConnectionEventListener in project java-bowler by NeuronRobotics.

the class BowlerAbstractServer method addServer.

public void addServer(BowlerAbstractConnection srv) {
    if (!servers.contains(srv)) {
        srv.addConnectionEventListener(new IConnectionEventListener() {

            @Override
            public void onDisconnect(BowlerAbstractConnection source) {
                Log.warning("Removing server from listener");
                removeServer(source);
            }

            @Override
            public void onConnect(BowlerAbstractConnection source) {
            }
        });
        servers.add(srv);
        srv.connect();
        srv.setSynchronousDatagramListener(this);
    }
}
Also used : BowlerAbstractConnection(com.neuronrobotics.sdk.common.BowlerAbstractConnection) IConnectionEventListener(com.neuronrobotics.sdk.common.IConnectionEventListener)

Aggregations

BowlerAbstractConnection (com.neuronrobotics.sdk.common.BowlerAbstractConnection)1 IConnectionEventListener (com.neuronrobotics.sdk.common.IConnectionEventListener)1