Operating System - HP-UX
1833196 Members
3090 Online
110051 Solutions
New Discussion

Unable to connect to port 12789

 
dhanish
Regular Advisor

Unable to connect to port 12789

HI ,
I am trying to run one engine on the port 12789 .but it says Unable to connect to the port 12789 ,port may be in use by another server.But when i see netstat -a and /etc/services this port is not listed anywhere.Any clues ??

Never Say Die
4 REPLIES 4
K.Vijayaragavan.
Respected Contributor

Re: Unable to connect to port 12789

Hi,

You may have to see the file /etc/rpc also as some of the ports are defined here.

You can even check the /etc/inetd.conf.

you can use the command #rpcinfo

-vijay
"Let us fine tune our knowledge together"
Tee How Long
Advisor

Re: Unable to connect to port 12789

Does your engine require u to create the entry in /etc/services ?
Robin Wakefield
Honored Contributor

Re: Unable to connect to port 12789

Hi,

Are you running "netstat -an" rather than "netstat -a", otherwise the port may show up by its name if it's in /etc/services.

Also, you could run

lsof -i tcp:12789

or

lsof -i udp:12789

if you have this utility.

Rgds, Robin.
rick jones
Honored Contributor

Re: Unable to connect to port 12789

/etc/services does _not_ "physically" reserve a port number. it is merely there as a convenience for us humans - allowing us to refer to services by names rather than port numbers.

if the software is trying to setup its listen endpoint, it should not use the word "connect" in its error messages as that implies it is trying to call connect() rather than bind() which is what would appear to be the socket call it would be making. using tusc against the app while it is starting would help confirm what socket calls it is making.

the suggestions about remembering to use -n in netstat when checking the output for the port number is good.

if you do find that there is an old connection still there, in any state other than LISTEN, it indicates that the software you are trying to start is broken and is not setting SO_REUSEADDR via setsockopt() prior to calling bind().

if the endpoint is in the LISTEN state it means that you _have_ to kill the still running older instance of the application.

in 99 situations out of 10, it is _not_ apropriate to use ugly hacks to arbitrarily abort endpoints out from under the application...
there is no rest for the wicked yet the virtuous have no pillows