Code example for SocketTimeoutException

0
    } 
 
 
    protected void onTimeout() { 
        if (handler != null) {
            clearHandler(new SocketTimeoutException());
        } 
        close(); 
    } 
 
 
    private void clearHandler(Throwable t) {
        SendHandler sh = handler;
        handler = null;
        if (sh != null) {
            if (t == null) {
                sh.onResult(new SendResult());
            } else { 
                sh.onResult(new SendResult(t));
            } 
        }