Before I start, sorry I don't know the solution.

I've tried to rewrite WSL (my changed, working but incomplete version attached).
Doing what I thought was more correct.
In that the socket channel was non-blocking such that; the write completes (and data buffer should not be touched) until the next select. Then read off the position to see if it's at the limit.

I've discovered that I'm getting into a intensive loop where send is 0.
I added code to 6207 for checking this, it happens, just not as much.

Reading the API.

SocketChannel.write
"A socket channel in non-blocking mode, for example, cannot write any more bytes than are free in the socket's output buffer."

i.e. The non-blocking behavior is to fill the output buffer and return and not what I presumed to write up to my data buffers limit.

So the buffer is full when send=0 is occurring.

Both version should only get selected when OP_WRITE has been set.
This should be when "corresponding channel is ready for writing".
But it isn't ready for writing the buffer is full!

I can only see an option for setting the size of the buffer, none for checking how full it is.

Any ideas.


Attachment: WriteSelectorLoop.zip
Description: Zip compressed data

_______________________________________________
Devl mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/devl

Reply via email to