File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes Server using java.nio 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 » Sockets and Internet Protocols
Bookmark "Server using java.nio" Watch "Server using java.nio" New topic
Author

Server using java.nio

shahabas shabeer
Ranch Hand

Joined: Feb 23, 2004
Posts: 49
Hi friends,
I have developed a chat server using java.net.
Now I would like to upgrade it using java.nio
Could anybody get me good liks to start with.
I would be happy if anybody could post some code samples here.

Thanks
Shahabas E Shabeer


The greatest pleasure in life is doing what peoples say you can not do.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8836
    
    7

"upgrading" to NIO is kind of a misnomer since the standard java.io classes use nio themselves. The reason to switch to NIO would be to use some of the features that are implemented in NIO which do not exist in the java.io classes, like non-blocking sockets. You can start with this article on Building Highly Scalable Servers with Java NIO


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

Joined: May 26, 2004
Posts: 42
Use a comm framework that is using non-blocking sockets: http://www.accendia.com


Catalin Merfu<br /><a href="http://www.accendia.com" target="_blank" rel="nofollow">High Performance Java Networking</a>
li dong
Greenhorn

Joined: Mar 19, 2005
Posts: 1
you can look at these NIO Socket examples
NIO Socket
 
Consider Paul's rocket mass heater.
 
subject: Server using java.nio
 
Similar Threads
Size File limit
Game Server nio package vs. ObjectOutputStream
NIO and JDK version
Copying a File
convert java.nio to equivalent in 1.3