Package com.esotericsoftware.kryonet

Examples of com.esotericsoftware.kryonet.Server.addListener()


    data.text = "some text here aaaaaaabbbbbccccc";
    data.stuff = new short[] {1, 2, 3, 4, 5, 6, 7, 8};

    startEndPoint(server);
    server.bind(tcpPort, udpPort);
    server.addListener(new Listener() {
      public void connected (Connection connection) {
        data.stuff[3] = 4;
        server.sendToAllTCP(data);

        data.stuff[3] = 123;
View Full Code Here


    a.add(null);
    a.add(34);

    startEndPoint(server);
    server.bind(tcpPort, udpPort);
    server.addListener(new Listener() {
      public void connected (Connection connection) {
        server.sendToAllTCP(data);
        connection.sendTCP(data);
        connection.sendTCP(a);
      }
View Full Code Here

    final ObjectSpace serverObjectSpace = new ObjectSpace();
    final TestObjectImpl serverTestObject = new TestObjectImpl(4321);
    serverObjectSpace.register((short)42, serverTestObject);

    server.addListener(new Listener() {
      public void connected (final Connection connection) {
        serverObjectSpace.addConnection(connection);
        runTest(connection, 12, 1234);
      }
View Full Code Here

    final ObjectSpace serverObjectSpace = new ObjectSpace();
    final TestObjectImpl serverTestObject = new TestObjectImpl(4321);
    serverObjectSpace.register((short)42, serverTestObject);

    server.addListener(new Listener() {
      public void connected (final Connection connection) {
        serverObjectSpace.addConnection(connection);
        runTest(connection, 12, 1234);
      }
View Full Code Here

    a.add(null);
    a.add(34);

    startEndPoint(server);
    server.bind(tcpPort, udpPort);
    server.addListener(new Listener() {
      public void connected (Connection connection) {
        server.sendToAllTCP(data);
        connection.sendTCP(data);
        connection.sendTCP(a);
      }
View Full Code Here

    final TestObjectImpl serverTestObject = new TestObjectImpl(4321);

    final ObjectSpace serverObjectSpace = new ObjectSpace();
    serverObjectSpace.register(42, serverTestObject);

    server.addListener(new Listener() {
      public void connected (final Connection connection) {
        serverObjectSpace.addConnection(connection);
        runTest(connection, 12, 1234);
      }
View Full Code Here

    final TestObjectImpl serverTestObject = new TestObjectImpl(4321);

    final ObjectSpace serverObjectSpace = new ObjectSpace();
    serverObjectSpace.register(42, serverTestObject);

    server.addListener(new Listener() {
      public void connected (final Connection connection) {
        serverObjectSpace.addConnection(connection);
      }

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

    // Both objects must be registered with the ObjectSpace.
    final ObjectSpace serverObjectSpace = new ObjectSpace();
    serverObjectSpace.register(42, serverTestObject);
    serverObjectSpace.register(777, serverTestObject.getOtherObject());

    server.addListener(new Listener() {
      public void connected (final Connection connection) {
        // Allow the connection to access objects in the ObjectSpace.
        serverObjectSpace.addConnection(connection);
      }
View Full Code Here

        // start server and add listener
        final Server server = new Server();
        server.start();
        server.bind(12_345);
        LogListener listener = new LogListener();
        server.addListener(listener);

        // start and connect client
        final Client client = new Client();
        client.start();
        client.connect(1_000, "localhost", 12_345);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.