• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

does anyone know how to write an NIO provider?

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Exactly what are you trying to do? Searching for "NIO Provider" produced a single interesting result and that doesn't really clear anything up.
 
Elihu Smails
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to write a unix domain socket provider for NIO.
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What would this provider do that java.net.Socket doesn't already?
 
Elihu Smails
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
bind to, listen, read and write to a unix domain socket.
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic