mIRC Homepage
Posted By: RRX /sockread limit of 4k - 05/01/08 05:20 PM
Is there a limit of 4k on the amount bytes a single /sockread can do? So impossible to have the socketbuffer full with 16k and read it in one time, so at least 4 on sockread event triggerings needed?
Posted By: tontito Re: /sockread limit of 4k - 05/01/08 05:58 PM
From Mirc Help file:

/sockread [-fn] [numbytes] <%var|&binvar>

If you specify a &binvar then [numbytes] of info is read into the binary variable. If no [numbytes] is specified it defaults to 4096 bytes.

So you can make it all in one read, if the socket has all the data stored already
Posted By: RRX Re: /sockread limit of 4k - 05/01/08 06:02 PM
Originally Posted By: tontito
From Mirc Help file:

/sockread [-fn] [numbytes] <%var|&binvar>

If you specify a &binvar then [numbytes] of info is read into the binary variable. If no [numbytes] is specified it defaults to 4096 bytes.

So you can make it all in one read, if the socket has all the data stored already

I think you misunderstood what I asked.
It's not about a default but about a limit.
I'll put it another way:
Does /sockread -f 8192 &somebinvar make sense or not?
Because if /sockread cannot read more than 4k in one time, then it doesnt make sense.
Posted By: Wims Re: /sockread limit of 4k - 05/01/08 10:38 PM
Originally Posted By: RRX
Does /sockread -f 8192 &somebinvar make sense or not?
Because if /sockread cannot read more than 4k in one time, then it doesnt make sense.
I think it make sense because there is a note after what you've quoted in the mirc help file about /sockread :
Quote:
Note: A single /sockread may not be enough to read the entire buffer. You should keep reading until $sockbr (bytes read) is set to zero. This is far faster than letting mIRC re-trigger the event. If your script doesn't read the whole buffer, the on sockread event is re-triggered if:
a) you were reading into a &binvar.
b) you were reading into a %var and there is still a $crlf terminated

Maybe it's not what you mean,but I think you'd be better to try
© mIRC Discussion Forums