mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2003
Posts: 282
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Feb 2003
Posts: 282
I made a script which open a connection to a website and read the html content.

Sometimes it opens the socked but fail with sending the commands.

I get:


/sockwrite: 'htmlread' not connected

I have no idea how to solve it. I even put a line fore the line which sends the command:
if ($sock(htmlread) == $null) halt


But still, it passes that line, and the error still happens.


A) How can I prevent from getting this error?
B) If I can't prevent it from happening, can I just hide it? (If yes, then how?)

Thanks.

Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
/help $sockerr

Please rtm next time. With all due respect, its written in plain english in the /help file.


-KingTomato
Joined: Feb 2003
Posts: 282
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Feb 2003
Posts: 282
Well I do have an "if ($sockerr != 0) halt
It still doesn't work

Last edited by saragani; 15/01/04 07:49 PM.
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
That error means you are attempting to write to a socket that has not yet connected succesfully, or immediately after it has closed.
Are you using the /sockwrite from inside an "on *:sockopen:..." event?

Joined: Feb 2003
Posts: 282
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Feb 2003
Posts: 282
No, I'm not using a sockwrite inside a sockopen.

After the socket was opened I check that there is no error and then I called an alias that writes to the website.

Anyway. I made it to double check for errors, and if there is an error, then it closes the socket and restart.

It seems to solve the problem somehow.

Thanks for your help.


Link Copied to Clipboard