mIRC Home    About    Download    Register    News    Help

Print Thread
#192580 05/01/08 05:20 PM
Joined: Jan 2004
Posts: 162
R
RRX Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: Jan 2004
Posts: 162
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?

Joined: Feb 2003
Posts: 307
T
Fjord artisan
Offline
Fjord artisan
T
Joined: Feb 2003
Posts: 307
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

Joined: Jan 2004
Posts: 162
R
RRX Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: Jan 2004
Posts: 162
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.

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard