| Hi Trustin Thanks for your reply. Binding first is absolutely no problem. I guess I just didn't think out-of-the-box enough to find the solution you posted here by myself. I tried using a DatagramConnector instead, but your way seems to be much more efficient: /* *** Sends more or less every 0.5 seconds a UDP message to destination and listens to answers on the same port **/ IoSession session; IoConnector connector = new DatagramConnector(); ConnectFuture future = connector.connect(destination, new InetSocketAddress (destination.getPort()), new UDPMinaTester( )); future.join(); try { session = future.getSession(); for(;;){ Thread.sleep(500); session.write(this.message); } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } I guess the whole "future" stuff is not necessary here, since there's never really a connection it could wait for, is that right? By the way: would the Mina team be interested in integrating NAT traversal code into to library? In one way (from app developper view) it's some kind of basic need, but to work it needs some kind of complex infrastructure, like a not NATed rendezvous server... Thanks for your great work with MINA! I tried to implement a clean code for NAT traversal for several weeks, before I discovered your framework. Starting again clean on top of Mina made it possible to write good code within three days! Cheers Dani Am 25.02.2006 um 10:32 schrieb Trustin Lee: Hi Dani, |
