I posted 2-3 days back with my xinetd service giving me error -
Address already in use at ./server.pl line 32.
I was suggested to use flag = REUSE in xinetd service and it did work fine. Now, the error has recreated and I don't the reason why. Need some pointers here.
my xinetd service
Part of my server.pl code -# default: on # description: Hello World socket server service sajan { socket_type = stream flags = REUSE wait = no user = root server = /tmp/server.pl log_on_success += USERID log_on_failure += USERID disable = no }
i have entry in /etc/services as - sajan 7890/tcp#!/usr/bin/perl -w # server1.pl - a simple server use strict; use Socket; use IO::Socket; use constant TCP_PORT => 7890; my $port = TCP_PORT; my $proto = getprotobyname('tcp'); sub logmsg { print "$0 $$: @_ at ", scalar localtime, "\n" } # create a socket, make it reusable socket(SERVER, PF_INET, SOCK_STREAM, $proto) or die "socket failed : $ +!\n"; setsockopt(SERVER, SOL_SOCKET, SO_REUSEADDR, 1) or die "setsock faile +d : $! \n"; # grab a port on this machine my $paddr = sockaddr_in($port, INADDR_ANY); # bind to a port, then listen bind(SERVER, $paddr) or die "bind failed : $!"; listen(SERVER, SOMAXCONN) or die "listen failed : $!"; print "Server started on port $port \n";
Need help to understand and resolve this. Thank you
In reply to Address Bind issue reincarnation by sajanagr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |