• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Nio : How to close a socket channel

 
Kris Adams
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Joe Ess
Bartender
Pie
Posts: 9266
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This question belongs in the Sockets and Internet Protocols forum.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic