Discussions

Performance and scalability: JAVA NIO DatagramChannel

  1. JAVA NIO DatagramChannel (2 messages)

    In the statement, for(Iterator i =readyKeys,iterator();i.hasNext();) SocketAddress sock = channel.receive(bytebuffer); the SocketAddress is sometimes null , even while iterating throught the readyKeys (selector.selectedKeys() Set). Could this be a bug in NIO?

    Threaded Messages (2)

  2. Re: JAVA NIO DatagramChannel[ Go to top ]

    The documentation states:
    If this channel is in non-blocking mode and a datagram is not immediately available then this method immediately returns null.
    When you use NIO, your NIO-related code needs to be fairly tolerant of conditions such as this. Peace, Cameron Purdy Tangosol Coherence: The Java Data Grid
  3. Re: JAVA NIO DatagramChannel[ Go to top ]

    I did handle for the null condition as stated in the java documentation. But practically, the application seems to be dropping the packets, which I confirmed using the wireShark/Ethereal application This happens only in a few variants of linux like Ubuntu etc.