in reply to Re: Creating a Server daemon in Socket Prograaming
in thread [SOLVED]Creating a Server daemon in Socket Programming

Hi

Forgot to mention that, the port 7890 i am using is not being elsewhere. The port is free.

I have used it in the daemon and then in the code. I think they are conflicting. I need to fix this, but I don't have the correct idea.

  • Comment on Re^2: Creating a Server daemon in Socket Prograaming

Replies are listed 'Best First'.
Re^3: Creating a Server daemon in Socket Prograaming
by Anonymous Monk on Jul 12, 2010 at 09:41 UTC
      Hi

      Can anyone give me guidelines how to make my server code to run as daemon continuously.

      I read something about PROC::Daemon. Is it useful? or can I do the same with xinetd ?

Re^3: Creating a Server daemon in Socket Prograaming
by sierpinski (Chaplain) on Jul 12, 2010 at 11:36 UTC
    the port 7890 i am using is not being elsewhere. The port is free.
    Are you sure? It seems your system thinks otherwise. How do you know what the port is free? Have you checked netstat -a |grep 7890?

    Generally useful error messages are... useful. If it says the port is in use, it probably is.
      Hi

      Thanks for the reply.

      The port is free. The code server.pl works fine when i run perl server.pl and close the service name "sajan".

      netstat -a |grep 7890 -> resulted nothing,means its free.

      The main deal i am trying here is the server to continuously run the server.pl code as daemon. Any alternatives than xinetd or any points where I should proceed ?

        If it is linux, I would look into inetd/xinetd. If it's Solaris, I'd recommend using an SMF service. There are probably plenty of daemon modules around, but I've never used any of them. As always in Perl, there is more than one way to do it.