<commit_before>package org.voovan.network;

import org.voovan.network.Event.EventName;
import org.voovan.network.exception.IoFilterException;
import org.voovan.network.exception.SendMessageException;
import org.voovan.network.handler.SynchronousHandler;
import org.voovan.network.udp.UdpSocket;
import org.voovan.tools.FastThreadLocal;
import org.voovan.tools.TObject;
import org.voovan.tools.collection.Chain;
import org.voovan.tools.buffer.TByteBuffer;
import org.voovan.tools.log.Logger;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.concurrent.TimeoutException;

/**
 * 事件的实际逻辑处理
 *
 * @author helyho
 *
 * Voovan Framework.
 * WebSite: https://github.com/helyho/Voovan
 * Licence: Apache v2 License
 */
public class EventProcess {

    /**
     * 私有构造函数,防止被实例化
     */
    private EventProcess(){

    }

    /**
     * Accept事件
     *
     * @param event
     *            事件对象
     * @throws IOException IO 异常
     */
    public static void onAccepted(Event event) throws IOException {
        SocketContext socketContext = event.getSession().socketContext();
        socketContext.acceptStart();
    }

    /**
     * 连接成功事件 建立连接完成后出发
     *
     * @param event 事件对象
     * @throws IOException IO 异常
     *
     */
    public static void onConnect(Event event) throws IOException {
        IoSession session = event.getSession();

        //客户端模式主动发起 SSL 握手, 由握手完成后再发起下一次 onConnect
        if (!session.getSSLParser().isHandShakeDone() &&
                session.socketContext().connectModel == ConnectModel.CLIENT) {
            session.getSSLParser().doHandShake();
            return;
        }
<commit_msg>fix: 修复 EventProcess 的 bug<commit_after>package org.voovan.network;

import org.voovan.network.Event.EventName;
import org.voovan.network.exception.IoFilterException;
import org.voovan.network.exception.SendMessageException;
import org.voovan.network.handler.SynchronousHandler;
import org.voovan.network.udp.UdpSocket;
import org.voovan.tools.FastThreadLocal;
import org.voovan.tools.TObject;
import org.voovan.tools.collection.Chain;
import org.voovan.tools.buffer.TByteBuffer;
import org.voovan.tools.log.Logger;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.concurrent.TimeoutException;

/**
 * 事件的实际逻辑处理
 *
 * @author helyho
 *
 * Voovan Framework.
 * WebSite: https://github.com/helyho/Voovan
 * Licence: Apache v2 License
 */
public class EventProcess {

    /**
     * 私有构造函数,防止被实例化
     */
    private EventProcess(){

    }

    /**
     * Accept事件
     *
     * @param event
     *            事件对象
     * @throws IOException IO 异常
     */
    public static void onAccepted(Event event) throws IOException {
        SocketContext socketContext = event.getSession().socketContext();
        socketContext.acceptStart();
    }

    /**
     * 连接成功事件 建立连接完成后出发
     *
     * @param event 事件对象
     * @throws IOException IO 异常
     *
     */
    public static void onConnect(Event event) throws IOException {
        IoSession session = event.getSession();

        //客户端模式主动发起 SSL 握手, 由握手完成后再发起下一次 onConnect
        if (session.isSSLMode() &&
                !session.getSSLParser().isHandShakeDone() &&
                session.socketContext().connectModel == ConnectModel.CLIENT) {
            session.getSSLParser().doHandShake();
            return;
        }

{'fraction_non_alphanumeric': 0.10764705882352942, 'fraction_numerical': 0.000588235294117647, 'mean_word_length': 2.882420091324201, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2139721', 'n_tokens_mistral': 1119, 'n_tokens_neox': 1139, 'n_words': 197}