[Mono-list] Socket.Poll only works after first read of data?
Francisco Figueiredo Jr.
fxjrlists at yahoo.com.br
Tue Mar 28 09:54:17 EST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi all,
I'm playing with Npgsql to implement CommandTimeout feature.
My idea is to use Socket.Poll method in order to do that.
After adding the infrastructure code to Npgsql, I faced an strange
problem, or maybe it is not strange, just my knowledge about it is :)
After I connect to a socket server, write some data and expect to
receive data, if I call Socket.Poll, it doesn't return true :( I passed
a timeout of 20 seconds: 1000000 * 20 with a SelectMode.Read
If I call socket.Read it works. The strange part of all this is that
after subsequent data exchange with server, Socket.Poll works like a
charm and doesn't timeout anymore.
Is this the way it should be working, or am I missing something?
I tried to put some Thread.Sleep() before calling Poll just to be sure
that it would not be a matter of the server is really taking to much
time to write data, but even with that, it didn't work :( I know it is
useless as on Poll call, I already add a 20 secs wait time.
Any clues?
Thanks in advance.
- --
Regards,
Francisco Figueiredo Jr.
http://fxjr.blogspot.com
Npgsql Lead Developer
http://pgfoundry.org/projects/npgsql
MonoBrasil Project Founder Member
http://monobrasil.softwarelivre.org
- -------------
"Science without religion is lame;
religion without science is blind."
~ Albert Einstein
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iQEVAwUBRClOGf7iFmsNzeXfAQKdZgf/UkZwEyzATO7gRdJjTuhHOAN4ONhqcqcZ
lJ++s8NeEVSFpBpfZh3GcEABgfFjYd9Qo4Zfj56dawbyrVITYeQ5HRYQ+Hmtytbg
DtD1MrKRSTq+lkK6Dc3KoJYpeS8N6PfXezN3k/BqrC7vRSTXYXtU266XaZx9ZmBJ
jwGbPpCeoPGHyeGSpp60HmPCElOLKC14ONg0gqYWScsO+zhJkg8wzPzQJMMc3QqW
NHHeo3pVQ6zQooHrLWyZelutZNJVppXTOYfN1otmgKq8aOcNHeB+8ncdKMthz0ku
gFKIVH4zSNkrirR+uBIrYcgLnXz5s8JGrzLZBniL/OycTOJKvfZNGA==
=m6io
-----END PGP SIGNATURE-----
_______________________________________________________
Novo Yahoo! Messenger com voz: Instale agora e faça ligações de graça.
http://br.messenger.yahoo.com/
More information about the Mono-list
mailing list