Ns_SockSendBufs() is not supposed to send all at once, that is the
problem. That's why small change i sent to Bernd should fix it, i just
do not want to commit it before the test.
Stephen Deasey wrote:
On 11/7/06, Zoran Vasiljevic <[EMAIL PROTECTED]> wrote:
On 07.11.2006, at 17:02, Bernd Eidenschink wrote:
I set logmaxlevel to 6 (dev) and I sometimes see lines like:
Debug: SockSend: Resource temporarily unavailable
Debug: SockSend: Resource temporarily unavailable
(...)
Out of the blue, I would not consider this a problem.
This is reading on an non-blocking socket that has no
bytes in the buffer. Some OS'es emit EAGAIN some
EWOULDBLOCK on that place (aparently this OS does EAGAIN).
It's writing, not reading... :-)
Anyway, this is actually an error, in the case of the writer thread at
least. In nsd/driver.c the writer thread calls Ns_SockSendBufs() and
if the return value is not the full amount, an error condition is
signalled.
I added the debug message because looking at the way code was calling
Ns_SockSendBufs() (or Ns_SockSend(), which actually doesn't have this
logging message, oops), it was expecting the call to succeed. This
wrapper function actually retries to send the data if the first
attempt fails, but it only retries *once*, and then it gives up.
If you see the above message then I believe the writer thread failed
to send all it's data and gave up.
I don't think the API is great. It confuses the issue of who's
responsible for ensuring data gets written. Is Ns_SockSend* supposed
to send all the data or not? I guess the issue is fudged because all
the socket is in non-blocking mode, because the read-side does in fact
do non blocking reads, the write side was always called by a conn
thread and was expecting to write everything before returning.
That isn't the case now that there is the writer thread stuff. But
either way it's still broken. It sort of half promises to send stuff.
Two attempts and then it gives up...
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel
--
Vlad Seryakov
571 262-8608 office
[EMAIL PROTECTED]
http://www.crystalballinc.com/vlad/