wood burning stoves 2.0*
The moose likes Sockets and Internet Protocols and the fly likes Nio : How to close a socket channel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Nio : How to close a socket channel" Watch "Nio : How to close a socket channel" New topic
Author

Nio : How to close a socket channel

Kris Adams
Greenhorn

Joined: Jul 02, 2004
Posts: 17
I am using socket channel for communication (created as shown below). Each time i use it, i am closing by invoking socketChannel.close(). But this doesnt seem to be closing the tcp connection.

SocketChannel socketChannel = SocketChannel.open();
socketChannel.connect(new InetSocketAddress(ip, port));
socketChannel.configureBlocking(false);

Can someone sugg the right way to terminate the connection.
J Kneeland
Ranch Hand

Joined: Aug 15, 2004
Posts: 31
http://64.233.179.104/search?q=cache:nq74MZJIs30J:forum.java.sun.com/thread.jsp%3Fforum%3D11%26thread%3D543017%26tstart%3D60%26trange%3D15+SocketChannel+close&hl=en
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8964
    
    9

This question belongs in the Sockets and Internet Protocols forum.


[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Nio : How to close a socket channel