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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 8836
    
    7

This question belongs in the Sockets and Internet Protocols forum.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
jQuery in Action, 2nd edition
 
subject: Nio : How to close a socket channel
 
Similar Threads
Question regarding the SocketChannel
SocketChannel And Socket Shutdown/recycle
Please verify if i understand NIO Selectors
nio and http request
detect disconnetced socketchannel on writes