On Tue, 04 Feb 2014 10:32:39 +0100, Sönke Ludwig wrote:

Am 04.02.2014 09:40, schrieb Damian Ziemba:

Hello.

I need help to get some basic things running up.

I would like to fire an event when data for read is available on file descriptor.

Something like this in C code:

event_new(event_base_new(), fd, EV_READ|EV_PERSIST, my_callback, obj);

but Vibed way. How can I achive that?

On GIT master, there is a generic createFileDescriptorEvent() function
in vibe.core.core that achieves this.

Another thing I would like to listen on unix socket instead of IP address. How can I do it?
Can I do something like

listenTCP(0, callback, "/tmp/my.sock", options);

?

There is currently no direct support for UNIX sockets, so the usual BSD
socket calls need to be used manually in conjunction with the
FileDescriptorEvent. Dedicated support would be nice to have, but
unfortunately I'm currently lacking the time to implement them.

I've started working on implementing that.
I should be able to make pull request today.

But I still don't know how to make working example with file descriptor.