[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[Libevent-users] beginner question wrt. windows, socketpair



Hello all,

I have a situation where I have a pipe, writing on one end, selecting
for reading on the other end with libevent. This works fine on Linux.

I expected some trouble with porting it to Windows, and sure enough, I
got it :) My first try was with CreatePipe, and passing the resulting
pipe handles to libevent. This didn't work (event_dispatch returns an
error).

Then I tried the evutil_socketpair function, which as far as I
understand does a workaround with a localhost TCP socket. This worked
fine - but it's twice the pipe I really need (bidirectional instead of
just one direction).

Furthermore, I will need to pass one end of a pipe as an STDIO handle
to a child process (using CreateProcess hStd{Input,Output,Error} - three
different pipes, really). I'm really not sure a TCP socketpair will work
here (TBH I haven't tried yet).

Is there a good way of doing this?

I'm using libevent 1.4.13 (from Debian).

Regards,
 Mate
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.