From f5f9e6ac3ac3a7343eaaee3a07d1d7866f22da5f Mon Sep 17 00:00:00 2001 From: panyufeng <3043130461@qq.com> Date: Tue, 8 Jun 2021 00:50:08 +0800 Subject: [PATCH] 222 --- test_conf/test_conf.cpp | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/test_conf/test_conf.cpp b/test_conf/test_conf.cpp index 0258027..4d5d9ed 100644 --- a/test_conf/test_conf.cpp +++ b/test_conf/test_conf.cpp @@ -30,14 +30,49 @@ int main() cout << methods[i] << endl; } - event_base* base = event_base_new_with_config(conf); + + //设置特征 + + + //初始化配置上下文 + event_base* base = event_base_new_with_config(conf); + if (!base) { cout << "event_base_new_with_config failed!" << endl; } else { + //确认特征是否生效 + int f = event_base_get_features(base); + if (f& EV_FEATURE_ET) { + cout << "EV_FEATURE_ET events are supported" << endl; + } + else { + cout << "EV_FEATURE_ET events are not supported" << endl; + } + if (f& EV_FEATURE_O1) { + cout << "EV_FEATURE_O1 events are supported" << endl; + } + else { + cout << "EV_FEATURE_O1 events are not supported" << endl; + } + if (f& EV_FEATURE_FDS) { + cout << "EV_FEATURE_FDS events are supported" << endl; + } + else { + cout << "EV_FEATURE_FDS events are not supported" << endl; + } + if (f& EV_FEATURE_EARLY_CLOSE) { + cout << "EV_FEATURE_EARLY_CLOSE events are supported" << endl; + } + else { + cout << "EV_FEATURE_EARLY_CLOSE events are not supported" << endl; + } + + + cout << "event_base_new_with_config success!" << endl; event_config_free(conf); }