Two Laptop Bag*
The moose likes Sockets and Internet Protocols and the fly likes SocketChannel And Socket Shutdown/recycle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "SocketChannel And Socket Shutdown/recycle" Watch "SocketChannel And Socket Shutdown/recycle" New topic
Author

SocketChannel And Socket Shutdown/recycle

Ahmed Basheer
Ranch Hand

Joined: Apr 15, 2004
Posts: 77
I am using Java NIO Sockets and am looking for a way to actually shutdown the tcp socket without closing the SocketChannel. I found method "socketShutdownInput" and "socketShutdownOutput" but they really don't disconnect the socket connection. Right after calling these method if you invoke SocketChannel.isConnected you will get true. Is this bug in Socket NIO or is there actually way to "diconnect", opposite in action to method "connect" on SocketChannel object which will only recyle the socket connection without closing the channel. The problem is if you close the channel then that channel needs to go through all the methods again like open, register etc...

Your suggestions or ideas would be appreciated.

Thanks,
Basheer
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SocketChannel And Socket Shutdown/recycle
 
Similar Threads
detect disconnetced socketchannel on writes
SocketChannel and OutputStream
How to recieve Objects using NIO Channels?
Nio : How to close a socket channel
Question regarding the SocketChannel