public class MultithreadedServer {
public static void main(String[] args) throws Exception {
RudpLocalEndpoint localEndpoint = new MultithreadedRudpLocalEndpoint(22222);
localEndpoint.addListener(new RudpDataListener() {
@Override
public void received(RudpDataEvent event) {
try {
System.out.println("Received " + (event.isReliable() ? "reliable" : "unreliable") +
" data of " + event.getInputStream().available() + " bytes");