From WikiChip
Difference between revisions of "mirc/on events/on udpwrite"
< mirc‎ | on events

m
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
The '''ON UDPWRITE''' is an event which was added in mIRC with UDP, but never has been documented. The event was meant to be used as the {{mIRC|on sockwrite}} event for TCP, however, something fucked up and the actual design ended up being that on sockwrite triggers for UDP socket if no error happened while on udpwrite will trigger if an error occured.
+
{{mirc title|On Udpwrite - Events}}
 +
The '''ON UDPWRITE''' is an event which was added in mIRC with UDP, but never has been documented. The event was meant to be used as the {{mIRC|on sockwrite}} event for TCP, however the actual design ended up being that:
 +
* on sockwrite triggers for UDP socket if no error happened
 +
* on udpwrite will trigger if an error occurred.
  
'''Note''': This behavior was changed for consistency and backward compatibility in mIRC 7.33:
 
  
-on udpwrite is no longer triggered.
+
'''Note:''' This behavior was changed for consistency and backward compatibility in mIRC 7.33:
-on sockwrite triggers for UDP socket regardless of the error state.
+
* on udpwrite is no longer triggered.
 +
* on sockwrite triggers for UDP socket regardless of the error state.
  
== Writting more ==
 
  
It is possible that the data hasn't sent successfuly, especially with UDP, you should be checking for error with {{mIRC|$sockerr} before trying to do anything, here is a list of the possible value for $sockerr in the on UDPWRITE event:
+
== Writing more ==
 +
 
 +
It is possible that the data hasn't sent successfuly, especially with UDP, you should be checking for error with {{mIRC|$sockerr}} before trying to do anything, here is a list of the possible value for $sockerr in the on UDPWRITE event:
  
 
* '''0''' - The data has been written sucessfuly.
 
* '''0''' - The data has been written sucessfuly.
Line 39: Line 43:
 
* {{mIRC|$sockerr}}
 
* {{mIRC|$sockerr}}
  
[[Category:MIRC on events|sockread]]
+
[[Category:mIRC on events|udpwrite]]

Latest revision as of 11:33, 21 September 2017

The ON UDPWRITE is an event which was added in mIRC with UDP, but never has been documented. The event was meant to be used as the on sockwrite event for TCP, however the actual design ended up being that:

  • on sockwrite triggers for UDP socket if no error happened
  • on udpwrite will trigger if an error occurred.


Note: This behavior was changed for consistency and backward compatibility in mIRC 7.33:

  • on udpwrite is no longer triggered.
  • on sockwrite triggers for UDP socket regardless of the error state.


Writing more[edit]

It is possible that the data hasn't sent successfuly, especially with UDP, you should be checking for error with $sockerr before trying to do anything, here is a list of the possible value for $sockerr in the on UDPWRITE event:

  • 0 - The data has been written sucessfuly.
  • 3 - Error occurred while trying to send the data, $sock().wsmsg will contain a more specific error message.

Examples[edit]

on *:udpwrite:name:{
  if ($sockerr) { echo -s An error occured while trying to read data: $sock($sockname).wsmsg | return }
}

Compatibility[edit]

Added: mIRC v5.5
Added on: 08 Jan 1999
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.


Removed: mIRC v7.33

Removed On:27/05/2014

See Also[edit]