Friday, January 06, 2006

Socket Interruption

To interrupt a sockect operation

SocketChannel channel = SocketChannel.open(new InetSocketAddress("localhost",8999));
try
{
in = new Scanner(channel);
while(true)
{
}

}
finally

{

channel.close();

}

Socket half close is to have client
to
socket.shutdownOuput() to close output stream
but socket still can read from input stream

No comments: