Skip to Content.
Sympa Menu

freetds - Re: [freetds] new network timeout code

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Peter Deacon <peterd AT iea-software.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] new network timeout code
  • Date: Sat, 6 Jan 2007 11:26:09 -0800 (Pacific Standard Time)

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




Archive powered by MHonArc 2.6.24.

Top of Page