> > > > Which is also a requirement.  When we call namedpipe_create, we have to 
> > > > RETURN
> > > > SOMETHING!
>
> Maybe not... What if we open a namedpipe in Windows in bidirectional mode. 
> Then we call
> CreateFile(pipename,...) for mode read and CreateFile(pipename, ...) for 
> write mode. Not
> tested but it might work.

Nope, doesn't work. The second CreateFile(pipename...) fails with message "All 
pipe
instances are busy".  CreateNamedPipe on Win32 expects to return the server 
side of the
pipe and there is no way around that fact that I am aware of.   This means that 
the
existing apr_file_namedpipe_create() function needs to change.  Perhaps like 
this:

When server calls apr_file_namedpipe_create, return the server side pipe:

apr_file_t *server_pipe;
apr_file_namedpipe_create(&server_pipe, filename, perms, server_side_pipe_mode, 
pool)

Client the calls apr_file_open(filename) to get the client side of the pipe.

When client and server are done with the pipe, call apr_file_close(server_pipe |
client_pipe);

Bill

Reply via email to