From WikiChip
Editing mirc/identifiers/$sockerr

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.

Latest revision Your text
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.
  
$sockerr is not a local identifier only set inside event, it is set after any /sock* command as well, meaning that $sockerr can change in value inside the same on sockread event.
+
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 11: Line 17:
 
== Properties ==
 
== Properties ==
 
None
 
None
 
== Error codes ==
 
 
Remember that using a /sock* command will change the $sockerr value, so these error codes must be checked prior any /sock* command
 
 
=== 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 these errors, $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 ==

Please note that all contributions to WikiChip may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see WikiChip:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)