I think the proxy implementation should be as transparent as possible.
Of course with a proxy in the middle, we have two levels of errors and we have only one to return to the application. Without having thinked about it too much, I would say that OnSessionConnected and OnSessionClosed should use the actual error code, no matter where it was generated (proxy or distant system). And since we need a second layer of error, probably a proxy specific error should be reported, if any, in a new property. What do you think ?


--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be


----- Original Message ----- From: "Arno Garrels" <arno.garr...@gmx.de>
To: "ICS support mailing" <twsocket@elists.org>
Sent: Thursday, February 10, 2011 3:32 PM
Subject: Re: [twsocket] Proxy traversal error handling


Francois PIETTE wrote:
Some proxies just close or reset the connection if, for instance, the
remote server is not listening or if Socks authentication fails for
some _technical reason. It's my understanding that in such cases
SessionConnected should be triggered with an error > 0 before
SessionClose, is that correct?
Currently both Socks and HTTP-Tunnel code in TWSocket  don't do
that but only trigger SessionClose, even without an error in case
of close (fin).

Yes, normally in case of a connection cannot be established,

OK.

OnSessionConnected should be called with a non nul error argument and
then OnSessionClosed with same argument.

Currently I do not think so.
With a proxy we have a special case, in case the connection to the
proxy is established successfully we delay OnSessionConnected until
we either passed thru or got some error response from the proxy.
Now if the proxy silently resets or closes the connection without
prior returning any error response while the tunnel is not established
yet the component should pass a proxy-specific error code to
OnSessionConnected and the true winsock error code to SessionClosed
IMO. Why must the error code in SessionClosed be faked as well?
Note that the true error code on SessionClosed in case above can
WSAECONNRESET or zero respectively.

--
Arno Garrels

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to