[Win32utils-devel] Asynchronous Pipe::Server problems

Heesob Park phasis at gmail.com
Mon May 19 22:57:20 EDT 2008


2008/5/20 Daniel Berger <djberg96 at gmail.com>:
> Hi all,
> I've been working on the win32-pipe library (again) and I've reworked the
> interface. Instead of Pipe.new_server or Pipe.new_client, there's now a base
> Pipe class, with Pipe::Server and Pipe::Client subclasses. You can find the
> latest code in the CVS repo.
> Oh, and you'll need to update your windows-pr library with the latest from
> CVS if you want to use this. I had to add some missing pipe related error
> constants to the Windows::Pipe module. These will be included in windows-pr
> 0.8.5.
> Anyway, I've got the synchronous mode working alright. Unfortunately, I
> can't get the asynchronous server to work. When I try to run the
> test_server_async.rb code (in CVS) I get this:
> VERSION: 0.2.0
> win32-pipe/lib/win32/pipe/server.rb:69:in `connect': Waiting for a
> process to open the other end of the pipe. (Win32::Pipe::Error)
> from test_server_async.rb:70:in `mainloop'
> from test_server_async.rb:101
> Any ideas?
Because ERROR_PIPE_LISTENING (536) is not an actual error, just ignore
it like this:

            case error
               when ERROR_IO_PENDING
                  @pending_io = true
               when ERROR_PIPE_CONNECTED
                  unless SetEvent(@handle)
                     raise Error, get_last_error(error)
               when ERROR_PIPE_LISTENING
                  # do nothing
                  raise Error, get_last_error(error)


Park Heesob

More information about the win32utils-devel mailing list