mIRC Homepage
Posted By: trenzterra Socket won't read last line - 05/05/03 11:39 AM
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?
Posted By: Nimue Re: Socket won't read last line - 05/05/03 11:43 AM
Try using sockread -f Temp
Posted By: trenzterra Re: Socket won't read last line - 05/05/03 12:33 PM
it will still not show anything although the error is gone. whats wrong
Posted By: Nimue Re: Socket won't read last line - 05/05/03 02:19 PM
Perhaps it's an empty line (containing only CRLF) Are you positive the last line should contain data?
Posted By: trenzterra Re: Socket won't read last line - 06/05/03 02:24 PM
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)
Posted By: ppslim Re: Socket won't read last line - 06/05/03 06:54 PM
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.
Posted By: Online Re: Socket won't read last line - 06/05/03 09:32 PM
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.
Posted By: trenzterra Re: Socket won't read last line - 08/05/03 07:51 AM
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
}
Posted By: Nimue Re: Socket won't read last line - 08/05/03 03:40 PM
Put an empty line after the line with the "." on its own.

e.g.
.
text text text
text text text
.
<empty line>
Posted By: Online Re: Socket won't read last line - 08/05/03 04:00 PM
Bug in -f?
Posted By: Nimue Re: Socket won't read last line - 08/05/03 04:04 PM
Seems like it, yes.
Posted By: trenzterra Re: Socket won't read last line - 09/05/03 03:46 PM
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?
© mIRC Discussion Forums