non blocking socket network sending and receiving
Posted on 2005-05-02
I have two sockets within a program. I want to send data from the local host using one socket. The other socket is used to receive data from other hosts. I wish to implement both of these together within one main program (No usage of any threads). I realize I have to use Java NIO, specifically the datagramchannel class (I'm using UDP). How do I generally go about doing this? Data may arrive and need to be sent asynchronously. That's the reason I'm trying to avoid blocking sockets.