Image

Imagefoxmagic wrote in Imagejava_dev

I'm fairly new to Java and I'm trying to figure out how to do non-blocking network connections with Java 1.4's SocketChannel object, so that I can write a telnet-like program (to begin with). But all the explanations I've seen so far are too complicated for me to figure out; they're all about handling multiple network streams at once. (edit: the examples I've found show how to make a non-blocking server, but I want an example of how to use this on the client side.)

If I only want to have a single connection open to a telnet server, can someone give me an example of how to read and write on it in a non-blocking way?