in reply to Using Sockets

It is fairly simple to make your server run as a daemon. See Super Search on 'daemon' for examples. The basic steps are to fork, exit the parent, and in the child close unneeded file handles, become session leader with &POSIX::setsid, change directory to /, and adjust umask to zero.

Such a daemon should select or use IO::Select to wait for its socket to become readable. The effect is to make the daemon sleep until there is work for it to do.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: Using Sockets
by grep (Monsignor) on Oct 28, 2002 at 02:57 UTC
    If the AM is on *nix I would also recommend looking at xinetd (the replacement for inetd).

    If the service is going to be used lightly then this would be a simpler to impliment and not require the overhead a full fledged deamon does.



    grep
    Mynd you, mønk bites Kan be pretti nasti...