java nio

Does anybody know how toregister a channel with read and write interest?I am developing a chat server where simultanous packet reads and writesare necessary.Any suggestions?regards....
[226 byte] By [n3bul4a] at [2007-11-26 20:19:37]
# 1

FileChannel channel = new RandomAccessFile(new File(fileName), "rw").getChannel();

http://java.sun.com/j2se/1.4.2/docs/api/java/io/RandomAccessFile.html#RandomAccessFile(java.io.File,%20java.lang.String)

http://java.sun.com/j2se/1.4.2/docs/guide/nio/

prometheuzza at 2007-7-10 0:43:44 > top of Java-index,Java Essentials,Java Programming...
# 2
I was thinking about registering a SocketChannel with read an writenot a FileChannel
n3bul4a at 2007-7-10 0:43:45 > top of Java-index,Java Essentials,Java Programming...
# 3

> I was thinking about registering a SocketChannel with

> read an write not a FileChannel

Ok, you have my permission to go ahead.

; )

SocketChannel API docs:

http://java.sun.com/j2se/1.4.2/docs/api/java/nio/channels/SocketChannel.html

NIO sockets examples:

http://www.exampledepot.com/egs/java.nio/pkg.html#Sockets

And check the NIO tutorial I posted earlier as well.

prometheuzza at 2007-7-10 0:43:45 > top of Java-index,Java Essentials,Java Programming...