Package com.peterhi.remote

Source Code of com.peterhi.remote.RemoteServer

package com.peterhi.remote;

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 {
        Thread.sleep(2000);
      }
      ri.fireEvent(null, "Hello World! " + i);
    }
  }
 
}
TOP

Related Classes of com.peterhi.remote.RemoteServer

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.