|
|
@ -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); |
|
|
|
} |
|
|
|