• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

does anyone know how to write an NIO provider?  RSS feed

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • 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: 9526
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
I want to write a unix domain socket provider for NIO.
 
Joe Ess
Bartender
Posts: 9526
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
bind to, listen, read and write to a unix domain socket.
 
Joe Ess
Bartender
Posts: 9526
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!