From WikiChip
Difference between revisions of "mirc/identifiers/$sockerr"
< mirc‎ | identifiers

m
(Added error codes from http://www.xise.nl/mirc/wiki/doku.php/doku.php?id=sockerr)
Line 1: Line 1:
 
{{mirc title|$sockerr identifier}}'''$sockerr''' returns the sock error number if an error occurred.
 
{{mirc title|$sockerr identifier}}'''$sockerr''' returns the sock error number if an error occurred.
 
For example, in the {{mIRC|on events/on sockopen|on sockopen}} event, if the connection is not established, $sockerr is set
 
 
Inside the on sockopen event:
 
* '''0''' - Success.
 
* '''3''' - Failure establishing socket connection: $sock($sockname).wsmsg will contain a more specific error message.
 
* '''4''' - Error resolving given hostname.
 
 
  
 
== Synopsis ==
 
== Synopsis ==
Line 17: Line 9:
 
== Properties ==
 
== Properties ==
 
None
 
None
 +
 +
== Error codes ==
 +
=== 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)
 +
* 2: error accepting new socket (W)
 +
* 4: not enough memory for new socket
 +
 +
=== 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
 +
 +
'''Note 1:''' (W) = For this error, $sock().wserr contains a specific WinSock error number and $sock().wsmsg the Winsock error text
 +
 +
'''Note 2:''' These codes were taken from http://www.xise.nl/mirc/wiki/doku.php/doku.php?id=sockerr
  
 
== Example ==
 
== Example ==

Revision as of 18:14, 8 December 2018

$sockerr returns the sock error number if an error occurred.

Synopsis

$sockerr

Parameters

None

Properties

None

Error codes

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)
  • 2: error accepting new socket (W)
  • 4: not enough memory for new socket

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

Note 1: (W) = For this error, $sock().wserr contains a specific WinSock error number and $sock().wsmsg the Winsock error text

Note 2: These codes were taken from http://www.xise.nl/mirc/wiki/doku.php/doku.php?id=sockerr

Example

on *:sockread:name:{
  if ($sockerr) return

}

Compatibility

Added: mIRC v5.3
Added on: 13 Dec 1997
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.


See Also

[Expand]
v · d · e mIRC identifier list