Hi Trustin,
I am really grateful for you fast reply.
as you say,I got confused , the next read loop is invoked by
Selector.select().Reading remaining data of the turn which left in the
buffer depends on the next read loop,what if Selector.select() won't return
again until a long long time?What if the client already finished its
sending of data which never cause the return of Selector.select()?In that
case ,is it the remaining data left in the buffer unreachable or neglected?
Best regards,
Andy (张园)
Mobile Internet Division
-------------------------------------------------------
Address: Building A9,Neusoft Park,No.2 Xinxiu Street,Hunnan
Industrial Park ,Shenyang 110179, PRC
Tel: +86 024 83669709 13998390079
Email:[EMAIL PROTECTED]
Website: http://www.neusoft.com
-----邮件原件-----
发件人: Trustin Lee [mailto:[EMAIL PROTECTED]
发送时间: 2008年1月15日 15:09
收件人: [email protected]
主题: Re: can anyone do me a favour
Hi Andy,
2008/1/14 张园 <[EMAIL PROTECTED]>:
> My dear friends,
>
> I got a question when I read the source code,how is the SocketIoProcessor
> class dealing the situation that the buf is smaller than the data expected
> in the SocketChannel?
If the allocated read buffer is smaller than the data to be read,
SocketIoProcessor will read it again in the next read loop, with the
increased read buffer size. It's exactly what the source code you
pasted is doing.
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6
----------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any
accompanying attachment(s) is intended only for the use of the intended
recipient and may be confidential and/or privileged of Neusoft Group Ltd., its
subsidiaries and/or its affiliates. If any reader of this communication is not
the intended recipient, unauthorized use, forwarding, printing, storing,
disclosure or copying is strictly prohibited, and may be unlawful. If you have
received this communication in error, please immediately notify the sender by
return e-mail, and delete the original message and all copies from your system.
Thank you.
-----------------------------------------------------------------------------------------------