The error codes of $sockerr

AuthorSaturn 2006/09/17 15:25

Every mIRC scripter who has ever worked with sockets, knows how important it is to check $sockerr in socket events. From the /sockread example in the mIRC helpfile, we also know that it is always a positive numerical value: zero on success, above zero if an error occurred. But exactly what are the error codes that $sockerr can return?

Below is a list of $sockerr codes and possible meanings, which are different per event. This list is not necessarily complete or even fully correct.

on SOCKOPEN

0: success
3: failure establishing socket connection (W)
4: error resolving given hostname

on SOCKLISTEN

0: new socket successfully accepted
1: error occurred on listening socket (W) (R)
2: error accepting new socket (W)
4: not enough memory for new socket (R)

on SOCKREAD

0: data received
3: error on connected socket occurred (W)

on SOCKWRITE

0: all data successfully written
3: error trying to send data (W)

on SOCKCLOSE

0: EOF from other end received
3: an error occurred while receiving data, or a SSL error occurred (W)
5: a certain(?) SSL error occurred during sockopen (R)

(W) = $sock().wserr contains a specific WinSock error in this case; (R) = extremely rare

sockerr.txt · Last modified: 2011/10/17 23:51 (external edit)
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki