[freetds] new network timeout code

Peter Deacon peterd at iea-software.com
Sat Jan 6 14:26:09 EST 2007


On Sat, 6 Jan 2007, James K. Lowden wrote:

> Code is wrong.  What if first cancel is lost in the network?  (Cf.
> TIME_WAIT.)  On timeout waiting for a cancel acknowledgement, we must send
> another cancel request if tdserror returns TDS_INT_TIMEOUT.  What the
> server does with two cancels is up to the server.  Eventually we'll get
> either an acknowledgement or EOF.

Data doesn't get lost when using TCP.  If it can't be transmitted and the 
OS finally gives up that just effect the state of the connection itself.

If you send cancel successfully it is received, when doing it async you 
will be notified via select if it isn't (tcp connection) times out.

If the server does not respond to your first message sending more isn't 
going to change anything.  The only benefit to sending additional messages 
is the realization that you will never get a response in the case the 
remote end disappears/isn't reachable/has long since forgotten about you. 
To cover those situations you normally send NOOP messages assuming the TDS 
protocol has them otherwise maybe the extra cancel messages are the NOOPs 
and I should just go away :)

take care,
Peter


More information about the FreeTDS mailing list