[freetds] removing a todo

ZIGLIO, Frediano, VF-IT Frediano.Ziglio at vodafone.com
Mon Jan 8 03:47:32 EST 2007


> 
> In net.c, there is this question about sendto(2) on a UDP port:
> 
> /* TODO is there a way to see if server reply with an ICMP (port not
> available) ?? */
> 
> 
> There is not.  Well, there is, but it is extremely difficult 
> and complex,
> taking up a whole chapter in Stevens's Unix Network Programming. 
> Certainly it's not worth it. 
> 

The problem is understanding if server cannot reply to our request. If
server reply that port is closed is useless to repeat loop 16 times.
I think that a better change would be to change comment to a 

/* There is no easy way to detect if port is closed so we always try to
get a reply from server 16 times */

You know, my memory is not so good so I bet that some years later I will
ask me the same question...

I think that removing tdserror call is not so good.
tds7_get_instance_port is called by tds_connect and if is not able to
get port is just return without any notice to library. We can't
dinstinguish between "server is not available" and "timeout" so I
notified a timeout. I agree that notifying a timeout on every loop is
not correct but at least when you finish loop and port is not valid
would be helpful.

freddy77



More information about the FreeTDS mailing list