org.xlightweb
Interface IHttpDisconnectHandler

Package class diagram package IHttpDisconnectHandler
All Superinterfaces:
IHttpConnectionHandler

public interface IHttpDisconnectHandler
extends IHttpConnectionHandler

The connect handler will be called if a http connection has been disconnected. Example:

  class MyHandler implements IRequestHandler, IHttpDisconnectHandler {
  
     ...
     
     public boolean onDisconnect(IHttpConnection httpConnection) throws IOException {
        IHttpConnection peerHttpConnection = (IHttpConnection) httpConnection.getAttachment();
        if (peerHttpConnection != null) {
           peerHttpConnection.close();
           httpConnection.setAttachment(null);
        }

        httpConnection.close();
        return true;
     }
     
     
     public void onRequest(HttpServerConnection httpServerConnection) throws IOException {
        
        ...
        
     }                  
  }        
 


Method Summary
 boolean onDisconnect(IHttpConnection httpConnection)
          see IDisconnectHandler
 

Method Detail

onDisconnect

boolean onDisconnect(IHttpConnection httpConnection)
                     throws IOException
see IDisconnectHandler

Throws:
IOException