Re: O_NONBLOCK in irmc

Phil Dibowitz <[email protected]> Mon, 09 Aug 2004 00:55:01 -0700
Newsgroups gmane.comp.gnome.apps.multisync.devel
Message-ID <[email protected]>
Armin Bauer wrote:
>>I was uber-conservative the first time and did a sleep(30) just before 
>>the close of the while() loop. This obviously took a very long time 
>>(sleep for 30 seconds after each write), but it WORKED! I've dropped it 
>>down to 5 and am recompiling now.
>>
>>This is probably much less than an ideal solution, but hopefully it'll 
>>help those more familiar with the codebase come up with a cleaner solution.
> 
> 
> I am not familiar with the irmc plugin, but shouldnt that be writen with
> poll/select to check if it is possible to write to the socket?

Okay, I've been looking into this for a while, and having a hard time 
wrapping my head around the code. Additionally someone (Al) from the 
linux-usb-devel list took an interest and has been helping me as well.

It turns out the code DOES do polling. We cannot, for the life of us, 
figure out why the sleep is needed.

We've tried a variety of things (including decreasing the buffer size 
int he pl2303 driver), but no matter what we do, I need that sleep() 
call in there to sync my phone. I've dropped it to a sleep(5) (haven't 
tried smaller yet), in order to sync my phone.

Any thoughts? I'm happy to try patches, or provide debugging info.

-- 
Phil Dibowitz                             [email protected]
Freeware and Technical Pages              Insanity Palace of Metallica
http://www.phildev.net/                   http://www.ipom.com/

"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."
  - Benjamin Franklin, 1759
signature.asc (application/pgp-signature, 256 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBFy3VN5XoxaHnMrsRAjAiAJsF2uExA5qR4azgHLhTKfDJjkZBQACfRRGg
7omuBfjwjcdYUWCrK8Wa2bE=
=FL2H
-----END PGP SIGNATURE-----