Windows Perl Scripting Forums » Perl

Inter-service Communication

(3 posts)


  1. pipes

    I have two services running on the same WinXP host, that need to communicate with each other when they receive updates. They now communicate with each other using a status file, but I'm looking for something better. Is there a simple way to pass notifications back and forth (like semaphores) using service status or error messages, without impacting the running services? I tried setting SERVICE_CONTROL_PARAMCHANGE, but that caused the service to pause. When I set the error value in the service status hash, then query the new service status using Win32::Service::GetStatus() or Win32::Daemon::State(), the error doesn't show up as a hash key or value.
    Posted 12 years ago #
  2. Dave
    Perl guy

    You could try using named pipes (via Win32::Pipe) in an async mode so there is no blocking. Alternatively you could try posting user messages to the service's message queue and see if they are plumbed down to your script. This may work if your service is using callbacks--it has been several years since we touched the code so I can not recall if this support was actually implemented.
    You could also try using Win32::Semaphore.
    Posted 12 years ago #
  3. pipes

    The semaphore solution is simple and does what I need; thanks!
    Posted 12 years ago #

RSS feed for this topic


You must log in to post.