Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost.asio] error Software caused connection abort
From: imin imup (iminimup_at_[hidden])
Date: 2010-03-31 18:30:35


> When I use a tcp socket to connect to remote host, I may get an "actively
refused"

>
> WSAECONNREFUSED == 10061
>
> > or "time out" error in 1st time.
>
> WSAETIMEDOUT == 10060
>
> > Then when I retry to connect to remote host, I "always" got "Software
> caused connection abort"
>
> WSAECONNABORTED == 10053
>
> http://msdn.microsoft.com/en-us/library/ms740668%28VS.85%29.aspx
>
> I don't know why you say the former two are "normal" -- actually all
> the tree mean that there's a problem with your host sockets: either
> there's no listening socket or it closes an accepted socket, or
> there's some other issue in the host.
>

Thanks a lot for helping. I'm still a newbie in asio/socket programming.
The socket may be used to connect to a remote host behind NAT which may send
back a RST packet or silently drop it. This is expected response.

It seems "Software caused connection abort" error is related to my program.
The document you pointed confirms this:

"An established connection was aborted by the software in your host
computer, possibly due to a data transmission time-out or protocol error."

The way I use can be sketched by:
============================
open a tcp socket
bind to a port
asynchronously connect to a remote host
in callback if it fails (may get expected errors), asynchronously reconnect
to remote host, up to specified times
In callback I get "abort" error after every reconnect

Any further help to debug this is appreciated.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net