wood burning stoves 2.0*
The moose likes I/O and Streams and the fly likes does anyone know how to write an NIO provider? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "does anyone know how to write an NIO provider?" Watch "does anyone know how to write an NIO provider?" New topic
Author

does anyone know how to write an NIO provider?

Elihu Smails
Ranch Hand

Joined: Jan 12, 2005
Posts: 37
I have been searching the internet and cannot find an example, tutorial or just documentation that shows what must be done.

If anyone has anything that might help me, I would appreciate it.

Thanks.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8836
    
    7

Exactly what are you trying to do? Searching for "NIO Provider" produced a single interesting result and that doesn't really clear anything up.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Elihu Smails
Ranch Hand

Joined: Jan 12, 2005
Posts: 37
I want to write a unix domain socket provider for NIO.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8836
    
    7

What would this provider do that java.net.Socket doesn't already?
Elihu Smails
Ranch Hand

Joined: Jan 12, 2005
Posts: 37
bind to, listen, read and write to a unix domain socket.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8836
    
    7

Ah, domain as opposed to internet sockets. Perhaps you could hack j-buds to support NIO or just use java.nio.SocketChannel on the loopback IP address.
Do you really need NIO-specific features (i.e. non-blocking sockets)? If not, there's really no compelling reason to use NIO instead of the java.io/java.net classes.
Elihu Smails
Ranch Hand

Joined: Jan 12, 2005
Posts: 37
This is on loopback. The reason for selecting unix domain sockets over TCP is that unix domain sockets are faster than TCP.

Also, I was hoping to poll a tcp-based connection and a unix domain socket connection with one call to poll(), instead of 2.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: does anyone know how to write an NIO provider?
 
Similar Threads
Working with consulting company
JBOSS Bangalore
Alphametics
Rounding decimal number to nearest 0.05
How much an author earns for a book?