freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: "Frediano Ziglio" <freddy77 AT gmail.com>
- To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
- Subject: Re: [freetds] connect(2) for UDP
- Date: Wed, 17 Dec 2008 10:35:39 +0100
2008/12/15 James K. Lowden <jklowden AT freetds.org>:
> Hello Frediano!
>
> /*
> * Request the instance's port from the server.
> * There is no easy way to detect if port is closed so we always try
> to
> * get a reply from server 16 times.
> */
> for (num_try = 0; num_try < 16; ++num_try) {
>
> But there is an easy way: use connect(2) and write(2) instead of sendto!
> connect(2) sets errno to ECONNREFUSED if no one is listening to the port,
> even for UDP.
>
> This would let us know immediately if port 1434 is reachable, and could
> reduce our retry loop to, say, three tries.
>
Mmmm... from comments
/*
* on cluster environment is possible that reply packet came from
* different IP so do not filter by ip with connect
*/
the problem is not that easy... if server has two interfaces
configured server reply from a single interface so it can happen that
client ask to an interface with a given IP but server reply from
another IP, in such situation with connect used recv don't receive
server reply :( I think we can solve this problem using two sockets,
one connected and another not connected.
freddy77
-
[freetds] connect(2) for UDP,
James K. Lowden, 12/15/2008
-
Re: [freetds] connect(2) for UDP,
Jackson, Craig (Gale), 12/15/2008
-
Re: [freetds] connect(2) for UDP,
James K. Lowden, 12/15/2008
- Re: [freetds] connect(2) for UDP, Jackson, Craig (Gale), 12/15/2008
-
Re: [freetds] connect(2) for UDP,
James K. Lowden, 12/15/2008
-
Re: [freetds] connect(2) for UDP,
Frediano Ziglio, 12/17/2008
-
Re: [freetds] connect(2) for UDP,
James K. Lowden, 12/17/2008
-
Re: [freetds] connect(2) for UDP,
Peter Deacon, 12/17/2008
-
Re: [freetds] connect(2) for UDP,
Peter Deacon, 12/18/2008
- Re: [freetds] connect(2) for UDP, Frediano Ziglio, 12/18/2008
- Re: [freetds] connect(2) for UDP, Jackson, Craig (Gale), 12/18/2008
- Re: [freetds] connect(2) for UDP, James K. Lowden, 12/18/2008
-
Re: [freetds] connect(2) for UDP,
Christos Zoulas, 12/18/2008
-
Re: [freetds] connect(2) for UDP,
James K. Lowden, 12/18/2008
- Re: [freetds] connect(2) for UDP, Christos Zoulas, 12/18/2008
-
Re: [freetds] connect(2) for UDP,
James K. Lowden, 12/18/2008
-
Re: [freetds] connect(2) for UDP,
Peter Deacon, 12/18/2008
-
Re: [freetds] connect(2) for UDP,
Peter Deacon, 12/17/2008
- Re: [freetds] connect(2) for UDP, Jackson, Craig (Gale), 12/17/2008
-
Re: [freetds] connect(2) for UDP,
James K. Lowden, 12/17/2008
-
Re: [freetds] connect(2) for UDP,
Jackson, Craig (Gale), 12/15/2008
Archive powered by MHonArc 2.6.24.