/** * Copyright (c) 2021 OceanBase * OceanBase CE is licensed under Mulan PubL v2. * You can use this software according to the terms and conditions of the Mulan PubL v2. * You may obtain a copy of Mulan PubL v2 at: * http://license.coscl.org.cn/MulanPubL-2.0 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. * See the Mulan PubL v2 for more details. */ #ifndef EASY_IO_STRUCT_H_ #define EASY_IO_STRUCT_H_ #include "easy_define.h" #include #include #include #include #include #include /** * IO结构定义 */ EASY_CPP_START #define EV_STANDALONE 1 #define EV_USE_MONOTONIC 0 #include "io/ev.h" #include "util/easy_pool.h" #include "util/easy_buf.h" #include "easy_list.h" #include "easy_atomic.h" #include "util/easy_hash.h" #include "thread/easy_uthread.h" #include "util/easy_inet.h" #include "util/easy_array.h" #include "util/easy_util.h" #ifdef EASY_DEBUG_DOING extern easy_atomic_t easy_debug_uuid; #endif ///// define #define EASY_MAX_THREAD_CNT 64 #define EASY_IOTH_DOING_REQ_CNT 65536 #define EASY_CONN_DOING_REQ_CNT 65536 #define EASY_WARN_LOG_INTERVAL 100 #define EASY_MSS 1024 #ifndef EASY_MAX_CLIENT_CNT #define EASY_MAX_CLIENT_CNT 65536 #endif #define EASY_EVENT_READ 1 #define EASY_EVENT_WRITE 2 #define EASY_EVENT_TIMEOUT 4 #define EASY_TYPE_SERVER 0 #define EASY_TYPE_CLIENT 1 #define EASY_CONN_OK 0 #define EASY_CONN_CONNECTING 1 #define EASY_CONN_AUTO_CONN 2 #define EASY_CONN_CLOSE 3 #define EASY_CONN_CLOSE_BY_PEER 4 #define EASY_CLIENT_DEFAULT_TIMEOUT 4000 #define EASY_FIRST_MSGLEN 1024 #define EASY_IO_BUFFER_SIZE (1024 * 32 - sizeof(easy_pool_t)) #define EASY_MESG_READ_AGAIN 1 #define EASY_MESG_WRITE_AGAIN 2 #define EASY_MESG_DESTROY 3 #define EASY_MESG_SKIP 4 #define EASY_REQUEST_DONE 1 #define EASY_IOV_MAX 256 #define EASY_IOV_SIZE 262144 #define EASY_FILE_READ 1 #define EASY_FILE_WRITE 2 #define EASY_FILE_SENDFILE 3 #define EASY_FILE_WILLNEED 4 // summary #define EASY_SUMMARY_CNT 64 #define EASY_SUMMARY_LENGTH_BIT 10 #define EASY_SUMMARY_LENGTH (1<