mIRC Home    About    Download    Register    News    Help

Print Thread
Sockread problem #216387 12/11/09 02:38 PM
Joined: Sep 2003
Posts: 156
B
bleach Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Sep 2003
Posts: 156
Hello,

When I use sockread command to retrieve HTTP data on a web page, it doesnt show data exactly. I think variables cant handle content cause its too long sometimes. Can anyone help me please.

Last edited by bleach; 12/11/09 02:40 PM.
Re: Sockread problem [Re: bleach] #216388 12/11/09 03:00 PM
Joined: Jun 2007
Posts: 933
5
5618 Offline
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Are you using binvars?

Re: Sockread problem [Re: 5618] #216391 12/11/09 08:25 PM
Joined: Sep 2003
Posts: 156
B
bleach Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Sep 2003
Posts: 156
Yes I tried them but when I echo data in active window, it doesnt show all data but when I write binvar to a txt file, it writes all of data. I dont understant.

Re: Sockread problem [Re: bleach] #216394 13/11/09 02:55 AM
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
/sockread
The -n switch allows you to read a $crlf terminated line into a &binvar. If the incoming line does not contain a $crlf, no bytes will be read into &binvar, unless you specify the -f switch, which forces the read (same as when reading into %vars).

Have you tried this? I don't that it will help but try /sockread -fn &bvar


Otherwise, show us your sockread code.

Re: Sockread problem [Re: bleach] #216396 13/11/09 07:45 AM
Joined: Jul 2008
Posts: 236
S
s00p Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Jul 2008
Posts: 236
Cut corners when you're writing an interpreter (for good reasons, usually) and you'll understand why smile but the basics are, if you join lots of data together rather than parsing it on the fly you might end up with inefficient code that spends most of it's time concatenating very long strings. Try processing (echoing) smaller parts (lines as suggested) at a time.