mIRC Home    About    Download    Register    News    Help

Print Thread
C
catogtp
catogtp
C
I'm debugging and old weather script and it works great most of the time. In 6.x it never showed these issues but in 7.x it now gives intermittent socket errors. The script echoes the error code to the window but other than that I don't really have much to go on. I added some identifiers to see if it's in the socketopen or socketread area and I am still waiting for the error to happen again. Are the socket error numbers based on the script or is there a list of mirc error codes somewhere that may help me here? socket error (3) is what I normally see.

Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
You probably have an echo in your sockread event similar to this:

Code:
if ($sockerr) { echo -s socket error ( $+ $sockerr $+ ) }


It doesn't have to look exactly like that, but most likely, you'll find $sockerr somewhere in there. Look for that part of the script and replace it with something similar to:

Code:
if ($sockerr) { echo -s socket error ( $+ $sockerr $+ : $sock($sockname).wsmsg $+ ) }


That will give the message as well as the code. Again, it doesn't have to look that way... just include the $sock($sockname).wsmsg echo inside the IF in whatever format you want and you'll have your message.

Joined: Jul 2006
Posts: 4,020
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,020
You can use $sock().wsmsg that return the winsock error message but here is a basic description :

1) impossible to interpret the request because of a format error
2) internal error from the server
3) address doesn't exist
4) request type not supported
5) access denied
6+) not documented


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
C
catogtp
catogtp
C
Thank you both.

This is what I see now:

socket open error ((3: [10060] Connection timed out))

Now I need to figure out why subsequent requests cause this error. Wondering if the site I use is limiting connections from clients.

It's using http 1.0 and spoofing it's user-agent as Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)

Joined: Jul 2006
Posts: 4,020
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,020
Here is a much better list of $sockerr's values for future reference
http://xise.nl/mirc/wiki/doku.php?id=sockerr


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

Link Copied to Clipboard