Re: [Nagios-devel] netutils use of socket descriptor
Posted: Wed Jun 17, 2009 7:18 pm
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Ethan Galstad wrote:
> Thomas Guyot-Sionnest wrote:
>> On 15/06/09 02:27 PM, Thomas Guyot-Sionnest wrote:
>>> A better way of doing this is to send a connect for the next ip in list
>>> every n miliseconds (where n is a small fraction of the timeout, you
>>> could for example take half of the timeout and divide it by the number
>>> of IP), use the first connected socket and clean up the rest.
>>
>>
>> Just for clarification I'm not necessarily saying that we should do it
>> this way, but that if we really want to try all IPs that's the way
>> (IMHO) it should be done.
>>
>> The attached patch removes the useless loop. There's no real-world
>> testing besides the compilation/tests.
>>
>
> Thanks - patch is in CVS.
While the above patch doesn't change any behavior, I was wondering if it
could loop in case we get a mix of IPv4/v6 addresses and one of the two
isn't supported. It looks like it would return EINVAL (Unknown protocol,
or protocol family not available.) in that case, but I'm not experienced
at all in sockets...
- --
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFKOU+G6dZ+Kt5BchYRAqwcAJ9OtzPbIQuoIuwB2Ydeqo0bWnTPpwCg5Nj8
otmNBJIiIO30THhxYGc1DuU=
=du7e
-----END PGP SIGNATURE-----
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Hash: SHA1
Ethan Galstad wrote:
> Thomas Guyot-Sionnest wrote:
>> On 15/06/09 02:27 PM, Thomas Guyot-Sionnest wrote:
>>> A better way of doing this is to send a connect for the next ip in list
>>> every n miliseconds (where n is a small fraction of the timeout, you
>>> could for example take half of the timeout and divide it by the number
>>> of IP), use the first connected socket and clean up the rest.
>>
>>
>> Just for clarification I'm not necessarily saying that we should do it
>> this way, but that if we really want to try all IPs that's the way
>> (IMHO) it should be done.
>>
>> The attached patch removes the useless loop. There's no real-world
>> testing besides the compilation/tests.
>>
>
> Thanks - patch is in CVS.
While the above patch doesn't change any behavior, I was wondering if it
could loop in case we get a mix of IPv4/v6 addresses and one of the two
isn't supported. It looks like it would return EINVAL (Unknown protocol,
or protocol family not available.) in that case, but I'm not experienced
at all in sockets...
- --
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFKOU+G6dZ+Kt5BchYRAqwcAJ9OtzPbIQuoIuwB2Ydeqo0bWnTPpwCg5Nj8
otmNBJIiIO30THhxYGc1DuU=
=du7e
-----END PGP SIGNATURE-----
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]