Package com.esotericsoftware.kryonet.Listener

Examples of com.esotericsoftware.kryonet.Listener.ThreadedListener


    // For consistency, the classes to be sent over the network are
    // registered by the same method for both the client and server.
    Network.register(client);

    // ThreadedListener runs the listener methods on a different thread.
    client.addListener(new ThreadedListener(new Listener() {
      public void connected (Connection connection) {
      }

      public void received (Connection connection, Object object) {
        if (object instanceof RegistrationRequired) {
View Full Code Here


    // For consistency, the classes to be sent over the network are
    // registered by the same method for both the client and server.
    Network.register(client);

    // ThreadedListener runs the listener methods on a different thread.
    client.addListener(new ThreadedListener(new Listener() {
      public void connected (Connection connection) {
      }

      public void received (Connection connection, Object object) {
        if (object instanceof RegistrationRequired) {
View Full Code Here

    Client client = new Client();
    register(client.getKryo());
    startEndPoint(client);

    // The ThreadedListener means the network thread won't be blocked when waiting for RMI responses.
    client.addListener(new ThreadedListener(new Listener() {
      public void connected (final Connection connection) {
        TestObject test = ObjectSpace.getRemoteObject(connection, 42, TestObject.class);
        // Normal remote method call.
        assertEquals(43.21f, test.other());
        // Make a remote method call that returns another remote proxy object.
View Full Code Here

TOP

Related Classes of com.esotericsoftware.kryonet.Listener.ThreadedListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.