On Wed, Sep 06, 2006 at 01:06:00PM +0100, Brian Raven wrote:
> Also, on a pedantic note, you cannot have multiple processes listening
> on a single port. Using SO_REUSEADDR means that multiple processes can
> bind to the port, but only one at a time can listen. This will no doubt
> be confused by using fork on Win32, which is emulated in Activestate
> Perl with threads.

On a pedantic, pedantic note... :-)

Multiple processes can bind to the same port - although it requires that
the underlying handle is shared between the processes. Under UNIX, this
is most often achieved using fork(). On WIN32 this should work using the
emulated fork(), but may not due to a bug in the rather complicated code
that attempts to emulate fork() on WIN32. I believe it is possible to
send handles between processes, although with all the emulation layers
in Perl (file descriptors, old-style sockets) it would be difficult or
impossible from pure-Perl.

Above it is suggested 'don't use fork on WIN32'. I would go further -
Don't write servers in Perl on WIN32. Use .Net, Java, or C++ as they
are all better supported, providing more native access to the
underlying system. Perl is a UNIX programming language, and breaks down
when pushed on WIN32.

Cheers,
mark

-- 
[EMAIL PROTECTED] / [EMAIL PROTECTED] / [EMAIL PROTECTED]     
__________________________
.  .  _  ._  . .   .__    .  . ._. .__ .   . . .__  | Neighbourhood Coder
|\/| |_| |_| |/    |_     |\/|  |  |_  |   |/  |_   | 
|  | | | | \ | \   |__ .  |  | .|. |__ |__ | \ |__  | Ottawa, Ontario, Canada

  One ring to rule them all, one ring to find them, one ring to bring them all
                       and in the darkness bind them...

                           http://mark.mielke.cc/

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to