The /sockwrite command allows you to send data to a TCP socket connection previously opened with /sockopen (See TCP sockets). You can specify a wildcard for the name to send the data to all matching sockets.
When the data has been sent, the on sockwrite event triggers.
mIRC will queue your request up to 16384 bytes, you must check how many bytes is the send buffer with $sock().sq before trying to queue on a socket
Note: If the queue is empty, (first /sockwrite ever for example), you can send more than that limit and it will be sent as chunk of the send queue limit or less.
/sockwrite -abnt <name> [numbytes] <text|%var|&binvar>
- -b - Indicates that you are specifying the numbytes value which is the number of bytes you want send, the full line is sent otherwise
- -n - Appens a $crlf to the line being sent if it's not a &binvar and does not already end with a $crlf
- -t - Forces mIRC to send anything beginning with a & as plain text
- -a - Prevents characters in the range 0-255 from being UTF-8 encoded as long as the line only contains characters in the range 0-255
- <name> - The socket name.
- [numbytes] - If -b has been specified, indicates the number of bytes you want to send.
- <text|%var|&binvar> - The message you want to send, can be a binary variable.
See the page for the on sockwrite event for more informations and examples about /sockwrite
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.
- List of commands
- List of identifiers
- on sockwrite
- on sockread