deimos.event2.listener

Undocumented in source.

Public Imports

deimos.event2.event
public import deimos.event2.event;

Members

Aliases

evconnlistener_cb
alias evconnlistener_cb = ExternC!(void function(evconnlistener*, evutil_socket_t, sockaddr*, int socklen, void*))

A callback that we invoke when a listener has a new connection.

evconnlistener_errorcb
alias evconnlistener_errorcb = ExternC!(void function(evconnlistener*, void*))

A callback that we invoke when a listener encounters a non-retriable error.

Functions

evconnlistener_disable
int evconnlistener_disable(evconnlistener* lev)

Stop listening for connections on an evconnlistener.

evconnlistener_enable
int evconnlistener_enable(evconnlistener* lev)

Re-enable an evconnlistener that has been disabled.

evconnlistener_free
void evconnlistener_free(evconnlistener* lev)

Disable and deallocate an evconnlistener.

evconnlistener_get_base
event_base* evconnlistener_get_base(evconnlistener* lev)

Return an evconnlistener's associated event_base.

evconnlistener_get_fd
evutil_socket_t evconnlistener_get_fd(evconnlistener* lev)

Return the socket that an evconnlistner is listening on.

evconnlistener_new
evconnlistener* evconnlistener_new(event_base* base, evconnlistener_cb cb, void* ptr, uint flags, int backlog, evutil_socket_t fd)

Allocate a new evconnlistener object to listen for incoming TCP connections on a given file descriptor.

evconnlistener_new_bind
evconnlistener* evconnlistener_new_bind(event_base* base, evconnlistener_cb cb, void* ptr, uint flags, int backlog, const(sockaddr)* sa, int socklen)

Allocate a new evconnlistener object to listen for incoming TCP connections on a given address.

evconnlistener_set_cb
void evconnlistener_set_cb(evconnlistener* lev, evconnlistener_cb cb, void* arg)

Change the callback on the listener to cb and its user_data to arg.

evconnlistener_set_error_cb
void evconnlistener_set_error_cb(evconnlistener* lev, evconnlistener_errorcb errorcb)

Set an evconnlistener's error callback.

Manifest constants

LEV_OPT_CLOSE_ON_EXEC
enum LEV_OPT_CLOSE_ON_EXEC;

Flag: Indicates that we should set the close-on-exec flag, if possible

LEV_OPT_CLOSE_ON_FREE
enum LEV_OPT_CLOSE_ON_FREE;

Flag: Indicates that freeing the listener should close the underlying * socket.

LEV_OPT_LEAVE_SOCKETS_BLOCKING
enum LEV_OPT_LEAVE_SOCKETS_BLOCKING;

Flag: Indicates that we should not make incoming sockets nonblocking * before passing them to the callback.

LEV_OPT_REUSEABLE
enum LEV_OPT_REUSEABLE;

Flag: Indicates that we should disable the timeout (if any) between when * this socket is closed and when we can listen again on the same port.

LEV_OPT_THREADSAFE
enum LEV_OPT_THREADSAFE;

Flag: Indicates that the listener should be locked so it's safe to use * from multiple threadcs at once.

Structs

evconnlistener
struct evconnlistener
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
sockaddr
struct sockaddr
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.

Meta