Examples of RudpServer


Examples of com.peterhi.net.rudp.RudpServer

import com.peterhi.net.rudp.RudpServer;

public class Server {

  public static void main(String[] args) throws Exception {
    RudpServer server = new RudpServer();
    RmRegistry registry = new RmRegistry(server, 15000);
    AboutMe am = new AboutMeImpl();
    registry.publish(AboutMe.class, "aboutMe", am);
    server.start(22222);
    Thread.sleep(8000);
    am.fireCallbackEvent("Callback occurred!");
    Thread.sleep(2000);
    am.fireCallbackEvent("Callback occurred 222!");
  }
View Full Code Here

Examples of com.peterhi.net.rudp.RudpServer

  public static void main(String[] args) throws Exception {
    work();
  }
 
  private static void work() throws Exception {
    RudpServer client = new RudpServer();
    final RmRegistry registry = new RmRegistry(client, 15000);
    client.start(0);
   
    SocketAddress address = new InetSocketAddress(
      InetAddress.getLocalHost(), 22222);
    final AboutMe am = registry.subscribe(address, AboutMe.class, "aboutMe");
    System.out.println(am.toString());
View Full Code Here

Examples of com.peterhi.net.rudp.RudpServer

import com.peterhi.net.rudp.RudpServer;

public class RemoteServer {

  public static void main(String[] args) throws Exception {
    RudpServer server = new RudpServer();
    RemoteRegistry registry = new RemoteRegistry(server, 8000);
    RemoteInterface ri = new RemoteInterfaceImpl();
    registry.publish("remoteInterface", RemoteInterface.class, ri);
    server.start(22222);
   
    for (int i = 0; i < 2; i++) {
      if (i == 0) {
        Thread.sleep(5000);
      } else {
View Full Code Here

Examples of com.peterhi.net.rudp.RudpServer

import com.peterhi.net.rudp.RudpServer;

public class RemoteClient {

  public static void main(String[] args) throws Exception {
    RudpServer client = new RudpServer();
    final RemoteRegistry registry = new RemoteRegistry(client, 8000);
    client.start(0);
    SocketAddress address = new InetSocketAddress(
      InetAddress.getLocalHost(), 22222);
    final RemoteInterface ri = registry.subscribe(address, "remoteInterface",
      RemoteInterface.class, 80000);
    System.out.println(ri);
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.