Hi all, I'm new here. Mina looks cool, so I'm looking to use it! I'm interested in writing an SNMP poller, which will issue SNMP GET requests to clients and then listen for responses. I've been studying the examples, most notably the UDP tutorial http://mina.apache.org/udp-tutorial.html. I can deal with the SNMP specific stuff easily enough (I'm planning to use snmp4j, but joesnmp also looks reasonable).
Anyway, my point of confusion is that UDP is a connectionless protocol, so seeing the UDP memory monitor client start by instantiating an NioDatagramConnector confuses me. From this connector we get a ConnectFuture, basically adopting an aysnchronous connection model. What is going on here? Asynch makes complete sense for a TCP connection where there's a handshake SYN, SYN-ACK, ACK that takes time. I dug in the code and find this goes all the way down to DatagramSocket provided by the jdk http://java.sun.com/javase/6/docs/api/java/net/DatagramSocket.html which has two connect methods. Despite the fact that UDP is connectionless, the docs for these methods don't really explain very well what the notion of connection that they are talking about is. Specifically, is anything being sent on the wire at connection time? If not, what's the benefit of the asynchronous IO model here? All I can verify happens is that a datagram connection basically sets up filters so UDP traffic only enters from the named socket endpoint and it allows the security checks to be done once upfront, instead of on every send or receive. Presumably this checks that we are allowed to use the network and port. Both of these sound local and fast and I'm wondering why to bother with asynch IO in this case. On the backend, it makes good sense to use a NIOAcceptor as arrivals may come in bursts and unbounded thread pools are bad. I wonder if anybody has looked at actor model implementations using scala, kilim, jetlang, or the like.
