On Mon, Jun 1, 2009 at 3:30 PM, tmountain <tinymount...@gmail.com> wrote:
>
> You're correct. Debugging with print statements shows that the
> otherwise clause is never being reached. That being said, simply
> inserting a Thread.sleep(0) before the data is returned makes the
> program behave properly. If I remove that sleep, the client gives back
> a malformed packet response. It seems like there's a race condition
> with the buffer not being totally full before it's returned, but I
> don't know how that could happen.

Just a guess, but maybe the Thread.sleep(0) causes another thread to
be scheduled, so that the sleep is in fact greater than 0.

-- 
Michael Wood <esiot...@gmail.com>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to