2008-02-09 (토), 13:04 -0600, David M. Lloyd 쓰시길: > Wilson Yeung wrote: > > It would be quite nice to be able to do something equivalent to sendto() > > with > > a DatagramAcceptor or a DatagramConnector. > > > > I've written a UDP application based on Mina that sends precisely 1 packet > > to 1 million end points, and waits for 1 packet from 1 million end points. > > Each 2 packet exchange is 1 Mina IoSession, and I continuously reuse the > > same 1000 - 5000 prebound IoSession objects, that is, I keep 1000 - 5000 of > > these exchanges in flight at a time.
How frequently are the messages exchanged? If it's less than once a minute, you could create a ExpiringIoSessionRecycler with longer timeout, which will decrease the overhead of session creation due to unnecessary timeout. > My opinion is that there should simply be one IoSession for all datagram > sockets. MINA cannot have a valid notion of a session because the underlying > protocol might not have such a notion. Creating IoSessions for every packet > or pair of packets is supremely wasteful. I agree. I even think this is an API design flaw which is very difficult to fix without revamping the API. It's mainly because MINA designed after TCP/IP model in its early stage. To implement UDP/IP support, I had to mimic the connection management using IoSessionRecycler. It might be the time to think about the way to fix the flaw. The change will be pretty big and will look like a whole new API though. Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/
signature.asc
Description: This is a digitally signed message part