Linux cpanel.rrshost.in 5.15.0-25-generic #25-Ubuntu SMP Wed Mar 30 15:54:22 UTC 2022 x86_64
Apache
: 109.123.238.221 | : 172.69.7.25
128 Domain
8.2.28
aev999
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
share /
doc /
libevent-dev /
examples /
[ HOME SHELL ]
Name
Size
Permission
Action
Makefile.sample
183
B
-rw-r--r--
dns-example.c
6.6
KB
-rw-r--r--
event-read-fifo.c
3.34
KB
-rw-r--r--
hello-world.c
3.39
KB
-rw-r--r--
hostcheck.c
6.47
KB
-rw-r--r--
http-connect.c
3.4
KB
-rw-r--r--
http-server.c
13.41
KB
-rw-r--r--
https-client.c
13.27
KB
-rw-r--r--
le-proxy.c
7.36
KB
-rw-r--r--
openssl_hostname_validation.c
6.93
KB
-rw-r--r--
signal-test.c
1.35
KB
-rw-r--r--
time-test.c
2.17
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : time-test.c
/* * XXX This sample code was once meant to show how to use the basic Libevent * interfaces, but it never worked on non-Unix platforms, and some of the * interfaces have changed since it was first written. It should probably * be removed or replaced with something better. * * Compile with: * cc -I/usr/local/include -o time-test time-test.c -L/usr/local/lib -levent */ #include <sys/types.h> #include <event2/event-config.h> #include <sys/stat.h> #ifndef _WIN32 #include <sys/queue.h> #include <unistd.h> #endif #include <time.h> #ifdef EVENT__HAVE_SYS_TIME_H #include <sys/time.h> #endif #include <fcntl.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <errno.h> #include <event2/event.h> #include <event2/event_struct.h> #include <event2/util.h> #ifdef _WIN32 #include <winsock2.h> #endif struct timeval lasttime; int event_is_persistent; static void timeout_cb(evutil_socket_t fd, short event, void *arg) { struct timeval newtime, difference; struct event *timeout = arg; double elapsed; evutil_gettimeofday(&newtime, NULL); evutil_timersub(&newtime, &lasttime, &difference); elapsed = difference.tv_sec + (difference.tv_usec / 1.0e6); printf("timeout_cb called at %d: %.3f seconds elapsed.\n", (int)newtime.tv_sec, elapsed); lasttime = newtime; if (! event_is_persistent) { struct timeval tv; evutil_timerclear(&tv); tv.tv_sec = 2; event_add(timeout, &tv); } } int main(int argc, char **argv) { struct event timeout; struct timeval tv; struct event_base *base; int flags; #ifdef _WIN32 WORD wVersionRequested; WSADATA wsaData; wVersionRequested = MAKEWORD(2, 2); (void)WSAStartup(wVersionRequested, &wsaData); #endif if (argc == 2 && !strcmp(argv[1], "-p")) { event_is_persistent = 1; flags = EV_PERSIST; } else { event_is_persistent = 0; flags = 0; } /* Initialize the event library */ base = event_base_new(); /* Initialize one event */ event_assign(&timeout, base, -1, flags, timeout_cb, (void*) &timeout); evutil_timerclear(&tv); tv.tv_sec = 2; event_add(&timeout, &tv); evutil_gettimeofday(&lasttime, NULL); setbuf(stdout, NULL); setbuf(stderr, NULL); event_base_dispatch(base); return (0); }
Close