(→See also) |
|||
Line 5: | Line 5: | ||
'''Note''' if /sockwrite fails, on sockwrite triggers too and {{mirc|$sockerr}} is set as well as {{mirc|$sock}}().wserr and {{mirc|$sock}}().wsmsg. | '''Note''' if /sockwrite fails, on sockwrite triggers too and {{mirc|$sockerr}} is set as well as {{mirc|$sock}}().wserr and {{mirc|$sock}}().wsmsg. | ||
+ | |||
+ | mIRC will queue your request up to 16384 bytes, you must check how many bytes is the send buffer with {{mirc|$sock}}().sq before trying to queue on a socket | ||
+ | |||
+ | '''Note''': If the queue is free, i.e. with a first /sockwrite, you can send more that limit, the limit only exist once the queue is filled. | ||
== Synopsis == | == Synopsis == | ||
Line 33: | Line 37: | ||
* [[List of commands - mIRC|List of commands]] | * [[List of commands - mIRC|List of commands]] | ||
* [[List of identifiers - mIRC|List of identifiers]] | * [[List of identifiers - mIRC|List of identifiers]] | ||
− | * [[ | + | * [[mIRC|/sockopen]] |
− | + | * [[mIRC|on sockwrite]] | |
− | * [[on sockwrite | + | * [[mIRC|on sockread]] |
− | * [[ | + | * [[mIRC|$sockerr]] |
{{mIRC command list}} | {{mIRC command list}} | ||
[[Category:MIRC commands]] | [[Category:MIRC commands]] |
Revision as of 18:41, 5 July 2014
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 sockes.
When the data has been sent, the on sockwrite event triggers.
Note if /sockwrite fails, on sockwrite triggers too and $sockerr is set as well as $sock().wserr and $sock().wsmsg.
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 free, i.e. with a first /sockwrite, you can send more that limit, the limit only exist once the queue is filled.
Synopsis
/sockwrite -bnt <name> [numbytes] <text|%var|&binvar>
Switches
- -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 or if does not already end with a $crlf
- -t - Forces mIRC to send anything beginning with a & as plain text
Parameters
- <name> - The sockname 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.
Example
Compatibility
Added: mIRC v5.3
Added On: 13/12/97
Note: Individual switches were not taken into consideration.
See also