Connection Refused???

Connection Refused???

Post by Vijaye Ganes » Fri, 26 May 2000 04:00:00



Hi,

When I try to connect to my local SMTP server, it sends this error message
"WSAECONNREFUSED".  Can anyone please explain, how a server can refuse a
connection, even before accepting it?

Also, I am able to connect to it thru Telnet.

Thanks,
Vijaye Ganesh

 
 
 

Connection Refused???

Post by Paul Chitesc » Fri, 26 May 2000 04:00:00



> Hi,

> When I try to connect to my local SMTP server, it sends this error message
> "WSAECONNREFUSED".  Can anyone please explain, how a server can refuse a
> connection, even before accepting it?

> Also, I am able to connect to it thru Telnet.

> Thanks,
> Vijaye Ganesh

You are trying to connect to a non listening address:port
- the address may be wrong
- the port may be wrong

Did you use htons(119) for the port number ?

--
 Paul Chitescu

 http://pchitescu.myip.org/     http://PaulC.MetroNet.RO.EU.org/
 ICQ:22641673

 
 
 

Connection Refused???

Post by Vijaye Ganes » Fri, 26 May 2000 04:00:00


That did it.. I forgot htons ()...

Thanks Paul



> Hi,

> When I try to connect to my local SMTP server, it sends this error message
> "WSAECONNREFUSED".  Can anyone please explain, how a server can refuse a
> connection, even before accepting it?

> Also, I am able to connect to it thru Telnet.

> Thanks,
> Vijaye Ganesh

You are trying to connect to a non listening address:port
- the address may be wrong
- the port may be wrong

Did you use htons(119) for the port number ?

--
 Paul Chitescu

 http://pchitescu.myip.org/     http://PaulC.MetroNet.RO.EU.org/
 ICQ:22641673

 
 
 

Connection Refused???

Post by Paul Chitesc » Fri, 26 May 2000 04:00:00



> That did it.. I forgot htons ()...
> [...]
> [...]
> Did you use htons(119) for the port number ?

Actually I prefer using getservbyname() whenever possible. Take a look to
a fragment of code from my NNTP server (written in Pascal, I'm a lazy
person).

.....
  var pe : ^ServEnt;
.....
  GetPrivateProfileString(WINNAME,'Port','nntp',bufr,sizeof(bufr)-1,
    IniName);
  Val(bufr,i,j);
  if j <> 0 then begin
    pe:=getservbyname(bufr,NIL);
    if pe = NIL then pe:=getservbyname('nntp',NIL);
    if pe = NIL then pe:=getservbyname('readnews',NIL);
    if pe <> NIL then i:=pe^.s_port
    else i:=htons(119);
  end
  else i:=htons(i);
  sadr.sin_family:=AF_INET;
  sadr.sin_addr.s_addr:=INADDR_ANY;
  sadr.sin_port:=i;
.....

--
 Paul Chitescu

 http://pchitescu.myip.org/     http://PaulC.MetroNet.RO.EU.org/
 ICQ:22641673

 
 
 

Connection Refused???

Post by Rowland Sha » Sat, 27 May 2000 04:00:00


There are nice new shiney additions coming to the winsock api that take port
numbers as textual strings now...

(Coming with IPv6)



> > When I try to connect to my local SMTP server, it sends this error
message
> > "WSAECONNREFUSED".  Can anyone please explain, how a server can refuse a
> > connection, even before accepting it?

> > Also, I am able to connect to it thru Telnet.

> You are trying to connect to a non listening address:port
> - the address may be wrong
> - the port may be wrong

> Did you use htons(119) for the port number ?

 
 
 

1. Connection Refused error hosing network

I have a component running in MTS that connects to a remote socket via TCP
to transmit data.  The service that I am connecting to has some bugs and
after a certain number of connection attempts, I can no longer connect
(getting "Connection Refused").  The vendor of the service is working on
correcting the issue, but it has brought to light another interesting
situation.  When the error occurs, all other components running in the
package lose the ability to make network connections until the package is
shut down.  This includes ADO connections and attempts to connect to IBM MQ.

Does anybody have an idea about what could be causing this and a possible
workaround?

Thanks in advance.

--

=========================
Kyle M. Burns, MCSD, MCT

2. External Power affects clock

3. connection refused problem

4. Site specific help

5. Win Services for UNIX 2.0 Connection Refused problem

6. newcomer

7. Socket Connection refused.

8. Mass Storage Model

9. Winsock error 10061 : Connection refused

10. Issues on Windows->sporadic "connection refused"

11. 10061 Connection Refused

12. Winsock Connection Refused Error

13. ASP socket connection refused