Ejemplo n.º 1
0
 /**
  * Close the connection. This method calls close on the input and output streams and interrupts
  * any thread in the handle method. may be specialized to close sockets etc.
  *
  * @exception IOException
  */
 public void close() throws IOException {
   try {
     _completing = true;
     if (_connection instanceof Socket && !(_connection instanceof SSLSocket))
       ((Socket) _connection).shutdownOutput();
     _outputStream.close();
     _inputStream.close();
   } finally {
     if (_handlingThread != null && Thread.currentThread() != _handlingThread)
       _handlingThread.interrupt();
   }
 }
Ejemplo n.º 2
0
 /* ------------------------------------------------------------ */
 protected void associateThread() {
   __threadConnection.set(this);
   _handlingThread = Thread.currentThread();
 }