users@grizzly.java.net

suitability for writing UDP servers

From: Radim Kolar SF.NET <hsn_at_sendmail.cz>
Date: Thu, 25 Oct 2007 02:13:10 +0200

> If I understand correctly your question, the SelectionKey is associated
> with the connection, not the packet. Hence all packets from the same
> connection use the same SelectionKey. It that what you ask?
I think Grizzly needs some tuning for better support for writing UDP
servers. His UDP support seems to be limited to writing udp client apps.

Main problem is:
   all UDP packets arriving into same server ip:server port combo are sharing same SelectionKey.
     this cause some problems:
        * at lot of places in code filters/other components are canceling SelectionKeys on io errors (such as UDP output buffer full). If they cancel SelectionKey, server socket is closed and nobody other
can use server until server is restarted.
        * DefaultSelectionKeyHandler closes server socket after 30 secs of
          inactivity
        * UDPWriteFilter Closes server socket after sending data too.