<div class="gmail_quote">On Fri, Jun 25, 2010 at 11:41 AM, Gerd Hoffmann <span dir="ltr"><<a href="mailto:kraxel@redhat.com">kraxel@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Also, the kqueue implementation in OS X 10.6 seem to have been broken,<br>
so I went with your suggestion and reimplemented the event handler using<br>
select(). One thing I noticed though was that the epoll implementation<br>
watched the fds for both read and write (add_to_poll()), but since it is<br>
edge triggered, it only fires once per change, but my select()<br>
implementation is level triggered, which meant it would never block and<br>
use up 100% CPU (for example monitoring a File fd, it always triggers).<br>
After playing a bit around with it, i decided to drop watching write for<br>
fds all together, and the client seem to work fine. Is there a need to<br>
check it or am I safe with monitoring only reads?<br>
</blockquote>
<br></div>
It isn't save. When you got -EAGAIN from a write() or send() syscall because the output pipe is full you have to watch for the socket becoming writable so you can flush out the bits you havn't sent yet.<br>
<br>
As far I know there is no bulk data going from client to server, so if you are working on a fast LAN it is quite possible that you never hit the "output pipe full" case and the client works fine for you.<div class="im">
<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Now on to the audio, I have been implementing audio using CoreAudio<br>
Framework for OS X (another idea could be OpenAL which is also<br>
cross-platform?), which pulls in a lot of extra headers, including<br>
MacTypes.h which unfortunately defines a "Rect" and "Point" struct which<br>
causes issues with the definitions inside common/draw.h. I can hack<br>
around it, but its not very nice, or I could rename the ones in spice,<br>
but that would break any compatibility with my patches to the current<br>
upstream code.<br>
</blockquote>
<br></div>
What code base you are working on? In the unstable tree the structs have been renamed to SpiceRect and SpicePoint exactly to avoid name clashes like this. Also the headers have been splitted away into a spice-protocol package.<br>
<br>
A few days ago Alex landed the marshaller bits in the unstable tree and the spice client can handle both 0.4 and unstable spice protocols now. So you can jump to the unstable code base even if you need the client play nicely with 0.4 spice servers. This will also make it easier to merge your patches upstream.<br>
<br>
HTH,<br><font color="#888888">
Gerd<br>
<br>
</font></blockquote></div>Hi Gerd,<br><br>Thanks for the fast reply! Sounds good! Yes, right now I've been working on version 0.4, but since the unstable tree is now backwards compatible, I will move on to that.<br><br>
Rgrds,<br><br>Attila<br>