Summary: | Notification messages are delayed until network activity | ||
---|---|---|---|
Product: | LinuxSampler | Reporter: | Grigor Iliev <gr.iliev> |
Component: | LSCP | Assignee: | Christian Schoenebeck <cuse> |
Status: | CLOSED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | SVN Trunk | ||
Hardware: | PC | ||
OS: | Linux | ||
Attachments: | patch for lscpserver.cpp |
Description
Grigor Iliev
2005-09-30 07:56:22 CEST
Created attachment 13 [details]
patch for lscpserver.cpp
I'm not sure anymore, but I think we had an issue with the timeout argument of select() and removed it from this section of the LSCP server due to this. But we can give it a try and see if somebody faces a problem. So go ahead and commit it please! OK, I found the old implementation in the CVS: http://cvs.linuxsampler.org/cgi-bin/viewcvs.cgi/linuxsampler/src/network/lscpserver.cpp?rev=1.23&content-type=text/vnd.viewcvs-markup Yes, there is an issue there (from `man select'): "On Linux, the function select modifies timeout to reflect the amount of time not slept; most other implementations do not do this. This causes problems both when Linux code which reads timeout is ported to other operating systems, and when code is ported to Linux that reuses a struct timeval for multiple selects in a loop without reinitializing it. Consider timeout to be undefined after select returns." In those implementation after the first invocation of select the timeout is set to 0, and than we have an endless loop, I think... Is there probably an autoconf check for this implementation difference? I don't think we should simply use "#if LINUX" or something. I think that it's ok now (for all platforms) because, now, the timout variable is set before every call to select function, so the select implementation in this case doesn't matter. This wasn't done in the old(removed) implementation. |