All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.smartboot.http.common.Handler Maven / Gradle / Ivy

There is a newer version: 2.5.1
Show newest version
/*******************************************************************************
 * Copyright (c) 2017-2021, org.smartboot. All rights reserved.
 * project name: smart-http
 * file name: Handle.java
 * Date: 2021-02-07
 * Author: sandao ([email protected])
 ******************************************************************************/

package org.smartboot.http.common;

import java.io.IOException;
import java.nio.ByteBuffer;

/**
 * 消息处理器
 *
 * @author 三刀
 * @version V1.0 , 2018/2/6
 */
public interface Handler {

    /**
     * 解析 body 数据流
     *
     * @param buffer
     * @param request
     * @return
     */
    void onBodyStream(ByteBuffer buffer, T request);


    /**
     * Http header 完成解析
     */
    default void onHeaderComplete(T request) throws IOException {
    }

    /**
     * 断开 TCP 连接
     */
    default void onClose(T request) {
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy