I am trying to write a server for a Windows machine
that is always listening on a particular port. When
the Server accepts a connection it should create a new
process and transfer the socket. The parent process
should go back to listening. I do this in the
following way:

Server:

while (1) {


 while(my $connection = $listen_socket->accept)
          {
                SpawnConnection($connection); 
                $connection->close;     
          }

}

sub SpawnConnection {
   my $socket = shift;
    
   
   Win32::Process::Create($ProcessObj,
   "c:\\perl\\bin\\perl.exe",
   "perl dbserverchild.pl $socket",
   0,
   NORMAL_PRIORITY_CLASS,
   ".");
}


In dbserverchild.pl, I get the socket by doing:
 my $socket = shift(@ARGV);

This does not work.

My question is, how do I pass a socket from one
process to another?
 
I have tried implementing my server using fork, but
fork seems to behave unreliably (doesn't always create
a child process). Any help would really really be
appreciated. Thanks!

Neel 




__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to