Loading ...
Sorry, an error occurred while loading the content.

Re: [Re: [soaplite] Forking daemon with win32 perl?]

Expand Messages
  • Andy Marden
    I do the same in my code - use Win32::Process for win32 platforms and fork for Unix. By testing the OS at runtime and then using the appropriate method, the
    Message 1 of 1 , Jun 26 1:58 AM
    • 0 Attachment
      I do the same in my code - use Win32::Process for win32 platforms and fork for
      Unix. By testing the OS at runtime and then using the appropriate method, the
      code becomes portable (there are plenty of libraries in the Perl distribution
      that do this kind of thing anyway).

      Cheers

      Andy

      "Weidong Wang" <wwang@...> wrote:

      > Here is the story.
      >
      > fork() on win32 is an emulation with threads. As such, if any "process" is
      not finished, the whole program will not exit. This presents a problem for me,
      as I wanted my SOAP code to launch a new daemon under certain condition and
      return the port number back to the soap clients. That does not work since the
      new deamon does not return, so the whole perl process does not return. The
      result is, my soap client waits forever.
      >
      > The solution, for win32, for this problem is to forget fork() and use
      Win32::Process to create a new process. That works, though it makes my code
      non portable.
      >
      >
      > Weidong
      >
      > ----- Original Message -----
      > From: Paul Kulchenko
      > To: soaplite@yahoogroups.com
      > Sent: Friday, June 22, 2001 4:23 PM
      > Subject: Re: [soaplite] Forking daemon with win32 perl?
      >
      >
      > Hi, Weidong!
      >
      > I would also like to hear opinions on that. ActiveState?
      >
      > I finished non-blocking TCP daemon and would like to add non-blocking
      > HTTP daemon. It might help you to get the result you want. Only I/O
      > is nonblocking, processing itself done by single thread, but this
      > solution works on almost any platform.
      >
      > Best wishes, Paul.
      >
      > --- "Dr. Weidong Wang" <wwang@...> wrote:
      > > Has anyone had good experience getting the forking daemon to work
      > > on win32 perl?
      > >
      > > I have been trying to get fork() to work reliably on win32 (win2k
      > > box), but it does not work as I expected. I first tried with the
      > > non-forking daemon, but call fork() in one function, The parent
      > > process is supposed to return quickly, while the child process to
      > > start anothr daemon program. What I got was, the new daemon would
      > > start, but the parent never returned anything, so the client just
      > > waited.
      > >
      > > Any ideas? Thanks.
      > >
      > > Weidong
      > >
      > >
      >
      >
      > __________________________________________________
      > Do You Yahoo!?
      > Get personalized email addresses from Yahoo! Mail
      > http://personal.mail.yahoo.com/
      >
      > Yahoo! Groups Sponsor
      >
      >
      >
      > To unsubscribe from this group, send an email to:
      > soaplite-unsubscribe@yahoogroups.com
      >
      >
      >
      > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.