Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

My app, ported from *nix, contains of several processes that use async TCP sockets (bound to 127.0.0.1) io for IPC. Unfortunately a lot of stupid windows firewalls try to block even traffic with 127.0.0.1, mostly listening. Some don't even warn user about blocking traffic, and my app malfunctions.

What are other IPCs that perl's select (at least from ActiveState perl) supports besides sockets? Ideally they should be available on Win9x too, but I can consider dropping support for win9x if none are available.

Thank you for your answer!

  • Comment on Which IPCs are available on Windows that support select() function besides sockets?

Replies are listed 'Best First'.
Re: Which IPCs are available on Windows that support select() function besides sockets?
by sgifford (Prior) on Oct 15, 2005 at 22:03 UTC
    If the processes that want to communicate have a common parent, you can use socketpair to create a non-IP socket they can talk over. The parent would have to create the sockets, then allow them to be inherited by a child across a fork.

    You can fake this up to an extent by creating a "launcher" program to create the sockets and start up the right programs. If you end up starting other scripts with exec or system, make sure you don't cause the file descriptors to be closed when you start the new program; the easiest way to do this is by setting $^F to a high number.

      Ummmm... the operating system is MSWin32... he doesn't have access to socketpair (according to perlport anyway) and definitely doesn't have access to fork. Unless he is running cygwin that is.
        I regularly use both socketpair and fork in my MSWin32 Perl apps with ActiveState perl, and both work OK, though fork can be a little fussy.

        It does seem that perlport(1) says socketpair is unavailable, which seems to be incorrect. My copy of perlport(1) says fork is properly emulated on Win32, though. This is the documentation that comes with Perl 5.8.1.

        It may be that socketpair is implemented in terms of IP sockets, though, which means it wouldn't help the OP. I don't recall, and don't have a copy of Windows handy to test with.

Re: Which IPCs are available on Windows that support select() function besides sockets?
by ambrus (Abbot) on Oct 15, 2005 at 21:53 UTC

    I don't know if windows has them, but if it has, you could use unix domain sockets (or any socket namespace other than ip).

    You can also use interpreted threads, then you don't have to know what the underlying ipc mechanism is.

      sorry. Unix domain sockets are only useful on Unix. Also, thread support has had a history of being rather delicate. Maybe it'll be ok, but you want to tread awful carefully.