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

m (Bot: adding missing title)
Line 1: Line 1:
 
{{mirc title|On Udpwrite - Events}}
 
{{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, 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.
+
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:
+
'''Note:''' This behavior was changed for consistency and backward compatibility in mIRC 7.33:
 
* on udpwrite is no longer triggered.
 
* on udpwrite is no longer triggered.
 
* on sockwrite triggers for UDP socket regardless of the error state.
 
* on sockwrite triggers for UDP socket regardless of the error state.
Line 39: Line 41:
 
* {{mIRC|$sockerr}}
 
* {{mIRC|$sockerr}}
  
[[Category:mIRC on events|sockread]]
+
[[Category:mIRC on events|udpwrite]]

Revision as of 10: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

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

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

Compatibility

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