Operating System - HP-UX
1827817 Members
2011 Online
109969 Solutions
New Discussion

connection refused while binding to a port

 
dhanish
Regular Advisor

connection refused while binding to a port

I am using a software which coonnects to a server running on hp ux at ort 23319.Now when i give the command netstat -an on the server it shows the socket connections (6 no's)established the client on the server and the server on the server itself.But when i connect the clinet which is their on my NT worlstation it says connection resfused.An clue whats hapening here??
Never Say Die
6 REPLIES 6
sven verhaegen
Respected Contributor

Re: connection refused while binding to a port

can you clarify a bit what is set exactly

is this a server program that rubns a specific listening socket with the nr you described or is this a spawned of socket session

netstat -an show the state of the socket , what is it in in listening , time-wait , etc...

you 'connect the cleint' what does this mean , is it a program that does a connect call ?? or do you activate the client and have its cleitn software try and contact the server software
...knowing one ignores a greath many things is the first step to wisdom...
dhanish
Regular Advisor

Re: connection refused while binding to a port

Yes its a server program which listens at port no.. 27991..i am pasting the o/p of netstat -an(i specified the wrong port no. by mistake in my prev post)

tcp 0 0 10.152.5.28.49364 10.152.5.28.27001 ESTABLISHED
tcp 0 0 10.152.5.28.49360 10.152.5.28.27551 ESTABLISHED
tcp 0 0 10.152.5.28.49359 10.152.5.28.27661 ESTABLISHED
tcp 0 0 10.152.5.28.49353 10.152.5.28.27991 ESTABLISHED
tcp 0 0 10.152.5.28.49342 10.152.5.28.27991 ESTABLISHED
tcp 0 0 10.152.5.28.49333 10.152.5.28.27991 ESTABLISHED

Now when i am trying to connect to port no 27991 on server....whose o/p is pasted above from my NT client which is client version ofg the same software whose server version is runing on the HP server and suppose to listen at port 27991.The client throws a error..connection refused.

thnks
Never Say Die
sven verhaegen
Respected Contributor

Re: connection refused while binding to a port

Ok I had a look at the netstat output , this is a standard line from there (not the socket you talked about but it looks like it):

tcp 0 0 10.152.5.28.49364 10.152.5.28.27001 ESTABLISHED

what this tells us is that socket 49364 is in use between 10.152.28 and the socket 27001 on 10.152.5.28 , both are the same machines

so we already have had a connect , the same is also seen for the socket you are talking about

what you would expect to see would be something like

tcp 0 0 *.(socket address) *.* LISTEN

It could be we get connection refused because the socket is already opened and is no longer listening, that would be easy to check by doing a netstat -an before launching the client application trying to connect , if however we do listen on the specified socket before connecting it could be a connect happens but the cleint is refused due to some security rules , errors in the communication etc...

does any of this data aply to your situation or did I misinterprete the data you provided or the exact problem ?




...knowing one ignores a greath many things is the first step to wisdom...
dhanish
Regular Advisor

Re: connection refused while binding to a port

Hi,
So what u essentially means to say is
i shud see the below line in my o/p on netstat -an.

tcp 0 0 10.152.5.28.27991 *.* LISTEN .

before launching the client from my NT workstation, only then my client will be able to bind to port 27991.But suppose in case...the server is of the kind inetd.which opens on the port whenver the request comes, then it wil no show as listen all the time .so in that case it will open the port the moment the request from client runnning on the NT workstation comes.So what will be case in that scenerio.

thnks

Never Say Die
Santosh Nair_1
Honored Contributor

Re: connection refused while binding to a port

Even if the server is started up by inetd, you should see it listening on the port, i.e. you should see the line:

tcp 0 0 *.(socket address) *.* LISTEN

when doing a netstat -na. Since this is not there, this is a good indication that inetd.conf is misconfigured or that it has some problem starting up the server. Check /var/adm/syslog/syslog.log for any errors. Also, after making changes to inetd.conf, did you tell inetd to re-read the configuration file by doing a inetd -c?

-Santosh
Life is what's happening while you're busy making other plans
dhanish
Regular Advisor

Re: connection refused while binding to a port

hi,
thnks for your suggestions , i will work on that.

thnks
Never Say Die