Re: [xSocket-develop] MaxReadSizeExceededException not thrown
Status: Inactive
Brought to you by:
grro
|
From: Mike C. <xs...@li...> - 2010-08-24 11:02:39
|
On 23/08/2010 23:30, Mike Cardwell wrote:
> I have a class defined as follows:
>
> public class MyHandler implements IDataHandler, IConnectHandler {
>
> in the onConnect method, I call the following on the
> INonBlockingConnection (nbc)
>
> nbc.setMaxReadBufferThreshold(10);
>
> In the onData method, I do this:
>
> try {
> String line = nbc.readStringByDelimiter("\n");
> } catch( MaxReadSizeExceededException e ){
> nbc.close();
> }
Ahhh. You can pass the maximum length as an argument to
readStringByDelimiter. Never mind, I answered my own question.
--
Mike Cardwell - Perl/Java/Web developer, Linux admin, Email admin
Read my tech Blog - https://secure.grepular.com/
Follow me on Twitter - http://twitter.com/mickeyc
Hire me - http://cardwellit.com/ http://uk.linkedin.com/in/mikecardwell
|