+ private new bind_unix(base: NativeEventBase, file: CString, factory: ConnectionFactory)
+ import ConnectionFactory.accept_connection, error_callback `{
+
+ ConnectionFactory_incr_ref(factory);
+
+ struct sockaddr_un sun = {0};
+ sun.sun_family = AF_UNIX;
+ strncpy(sun.sun_path, file, sizeof(sun.sun_path) - 1);
+
+ struct evconnlistener *listener = evconnlistener_new_bind(base,
+ (evconnlistener_cb)accept_connection_cb, factory,
+ LEV_OPT_CLOSE_ON_FREE | LEV_OPT_REUSEABLE, -1,
+ (struct sockaddr*)&sun, sizeof(sun));
+ if (listener != NULL) {
+ evconnlistener_set_error_cb(listener,
+ (evconnlistener_errorcb)ConnectionListener_error_callback);
+ }
+
+ return listener;
+ `}
+