import com.peterhi.obsolete.Endpoint;
public class ServerApp {
public static void main(String[] args) throws Exception {
Endpoint ep = new Endpoint(22222);
ep.addEndpointListener((e) -> {
String reliableStr = e.isReliable() ? "reliable" : "unreliable";
System.out.println(MessageFormat.format(
"Received {0} bytes of {1} data.",
e.getData().length, reliableStr));
});
ep.start();
}