Browse Source

222

master
panyufeng 3 years ago
parent
commit
f5f9e6ac3a
1 changed files with 36 additions and 1 deletions
  1. +36
    -1
      test_conf/test_conf.cpp

+ 36
- 1
test_conf/test_conf.cpp View File

@ -30,14 +30,49 @@ int main()
cout << methods[i] << endl; cout << methods[i] << endl;
} }
event_base* base = event_base_new_with_config(conf);
//设置特征
//初始化配置上下文
event_base* base = event_base_new_with_config(conf);
if (!base) { if (!base) {
cout << "event_base_new_with_config failed!" << endl; cout << "event_base_new_with_config failed!" << endl;
} }
else { 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; cout << "event_base_new_with_config success!" << endl;
event_config_free(conf); event_config_free(conf);
} }


Loading…
Cancel
Save