mIRC Home    About    Download    Register    News    Help

Print Thread
Socket won't read last line #22466 05/05/03 11:39 AM
Joined: Dec 2002
Posts: 196
T
trenzterra Offline OP
Vogon poet
OP Offline
Vogon poet
T
Joined: Dec 2002
Posts: 196
Hi i use a socket to check for updates on my website, but when I notice when i use /echo -a %temp (after sockread %temp of course), it always show an error for the last line and not show it...

Whats the problem with it?


trenzterra
AustNet #trenzterra and #w
Head Scripter @ http://trenzterra.uni.cc
Re: Socket won't read last line #22467 05/05/03 11:43 AM
Joined: Dec 2002
Posts: 699
N
Nimue Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
Try using sockread -f Temp

Re: Socket won't read last line #22468 05/05/03 12:33 PM
Joined: Dec 2002
Posts: 196
T
trenzterra Offline OP
Vogon poet
OP Offline
Vogon poet
T
Joined: Dec 2002
Posts: 196
it will still not show anything although the error is gone. whats wrong


trenzterra
AustNet #trenzterra and #w
Head Scripter @ http://trenzterra.uni.cc
Re: Socket won't read last line #22469 05/05/03 02:19 PM
Joined: Dec 2002
Posts: 699
N
Nimue Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
Perhaps it's an empty line (containing only CRLF) Are you positive the last line should contain data?

Re: Socket won't read last line #22470 06/05/03 02:24 PM
Joined: Dec 2002
Posts: 196
T
trenzterra Offline OP
Vogon poet
OP Offline
Vogon poet
T
Joined: Dec 2002
Posts: 196
well it has a fullstop on the last line.

and on all other pages i tried it doesn't work too (which has </html> on the last line)


trenzterra
AustNet #trenzterra and #w
Head Scripter @ http://trenzterra.uni.cc
Re: Socket won't read last line #22471 06/05/03 06:54 PM
Joined: Dec 2002
Posts: 44
P
ppslim Offline
Ameglian cow
Offline
Ameglian cow
P
Joined: Dec 2002
Posts: 44
Is your site retuning a CRLF after the line in question?

mIRC splits texts using this as the toekn delimeter, without it, it doesn't know the line is complete.


Suck it, lick it, milk it then put it away.
Re: Socket won't read last line #22472 06/05/03 09:32 PM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Interesting. If you haven't yet found a solution, please post your code here in addition to the website address, so we can reproduce the bug and see what's wrong.

Re: Socket won't read last line #22473 08/05/03 07:51 AM
Joined: Dec 2002
Posts: 196
T
trenzterra Offline OP
Vogon poet
OP Offline
Vogon poet
T
Joined: Dec 2002
Posts: 196
on *:sockopen:mirc:{
sockwrite -n $sockname GET /scriptupdate/versions.txt HTTP/1.1
sockwrite -n $sockname Host: trenzterraz.sourceforge.net $+ $str($crlf ,2)

sockwrite -n $sockname Connection: Keep-Alive

}

on *:sockread:mirc:{
sockread -f %temp
echo -a %temp
}


trenzterra
AustNet #trenzterra and #w
Head Scripter @ http://trenzterra.uni.cc
Re: Socket won't read last line #22474 08/05/03 03:40 PM
Joined: Dec 2002
Posts: 699
N
Nimue Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
Put an empty line after the line with the "." on its own.

e.g.
.
text text text
text text text
.
<empty line>

Re: Socket won't read last line #22475 08/05/03 04:00 PM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Bug in -f?

Re: Socket won't read last line #22476 08/05/03 04:04 PM
Joined: Dec 2002
Posts: 699
N
Nimue Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
Seems like it, yes.

Re: Socket won't read last line #22477 09/05/03 03:46 PM
Joined: Dec 2002
Posts: 196
T
trenzterra Offline OP
Vogon poet
OP Offline
Vogon poet
T
Joined: Dec 2002
Posts: 196
that solves it, but not all html pages on the internet will change that just for one application called mIRC.

it would be better if mIRC 'fixed' that?


trenzterra
AustNet #trenzterra and #w
Head Scripter @ http://trenzterra.uni.cc