Created
April 4, 2020 23:05
-
-
Save azat/de3570933a86732e06add8620604aa2c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/libevent/libevent/issues/984 | |
#include <event2/event.h> | |
#include <assert.h> | |
void readcb(int fd, short events, void *arg) | |
{ | |
printf("%s: fd=%i, events=%hi\n", __func__); | |
} | |
void closecb(int fd, short events, void *arg) | |
{ | |
printf("%s: fd=%i, events=%hi\n", __func__); | |
} | |
int main() | |
{ | |
struct event_base *base = event_base_new(); | |
//struct event *ev1 = event_new(base, 0, EV_READ, readcb, NULL); | |
struct event *ev2 = event_new(base, 0, EV_CLOSED|EV_ET, closecb, NULL); | |
//assert(!event_add(ev1, NULL)); | |
assert(!event_add(ev2, NULL)); | |
return event_base_dispatch(base); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment