From WikiChip
Difference between revisions of "mirc/on events/on udpwrite"
m (bot: cat fixing naming) |
m |
||
(3 intermediate revisions by 3 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 | + | {{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''' | + | |
+ | '''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. | ||
+ | |||
== Writing more == | == Writing more == | ||
Line 38: | Line 43: | ||
* {{mIRC|$sockerr}} | * {{mIRC|$sockerr}} | ||
− | [[Category:mIRC on events| | + | [[Category:mIRC on events|udpwrite]] |
Latest revision as of 10:33, 21 September 2017
Commands & Identifiers
Basics
Events
Matching Tools
Data Storage
Control Structures
GUI Scripting
Sockets
Advanced Scripting
Additional Resources
Security
Other
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