Package com.peterhi.net2

Examples of com.peterhi.net2.ServerApp


public class ServerApp {

  public static void main(String[] args) throws Exception {
    Endpoint endpoint = new Endpoint(22222);
    endpoint.addEndpointDataListener(new EndpointDataListener() {
      @Override
      public void received(EndpointDataEvent event) {
        System.out.println("Received " + new String(event.getData()) + ", from " + event.getAddress());
      }
    });
View Full Code Here


public class ClientApp {

  public static void main(String[] args) throws Exception {
    Endpoint endpoint = new Endpoint(0);
    endpoint.addEndpointStateListener(new EndpointStateListener() {
      @Override
      public void started(EndpointEvent event) {
        Endpoint endpoint = (Endpoint )event.getSource();
        InetAddress address;
       
View Full Code Here

TOP

Related Classes of com.peterhi.net2.ServerApp

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.