From WikiChip
Editing mirc/commands/sockwrite

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.

Latest revision Your text
Line 1: Line 1:
{{mirc title|/sockwrite Command}}
+
The '''/sockwrite command''' allows you to send data to a TCP socket connection previously opened with [[/sockopen - commands|/sockopen]] (See [[TCP Sockets - mIRC|TCP sockets]]).
The '''/sockwrite command''' allows you to send data to a TCP socket connection previously opened with [[/sockopen commands - mIRC|/sockopen]] (See [[TCP Sockets - mIRC|TCP sockets]]).
 
You can specify a {{mirc|wildcard}} for the name to send the data to all matching sockets.  
 
  
When the data has been sent, the {{mIRC|on sockwrite}} event triggers.
+
'''Note''': if /sockwrite fails, it sets [[$sock identifier - mIRC|$sock().wserr]] to the error value, and triggers on sockwrite with [[$sockerr identifier - mIRC|$sockerr]] set etc.
 
 
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 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.
 
  
 
== Synopsis ==
 
== Synopsis ==
/sockwrite -abnt <name> [numbytes] <text|%var|&binvar>
+
/sockudp -bnt <name> [numbytes] <text|%var|&binvar>
  
 
== Switches ==
 
== 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
 
* '''-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 {{mIRC|$crlf}} to the line being sent if it's not a &binvar and does not already end with a $crlf
+
* '''-n''' - Appens a [[$crlf identifier - mIRC|$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
 
* '''-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
 
  
 
== Parameters ==
 
== Parameters ==
* '''<name>''' - The socket name.
+
* '''<name>''' - The sockname name.
 
* '''[numbytes]''' - If -b has been specified, indicates the number of bytes you want to send.
 
* '''[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.
 
* '''<text|%var|&binvar>''' - The message you want to send, can be a binary variable.
  
'''Note''': if /sockwrite fails, {{mirc|$sockerr}} is set as well as {{mirc|$sock}}().wserr and {{mirc|$sock}}().wsmsg inside the {{mirc|on events/on sockwrite|on sockwrite}} event.
+
== Example ==
 +
 
 +
== Compatibility ==
 +
Added: mIRC v5.3
  
== Example ==
+
Added On: 13/12/97
  
See the page for the {{mIRC|on events/on sockwrite|on sockwrite}} event for more informations and examples about /sockwrite
 
  
== Compatibility ==
+
<small>Note: Individual switches were not taken into consideration.</small>
{{mIRC compatibility|5.3}}
 
  
 
== See also ==
 
== See also ==
 
* [[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}}
+
* [[on udpread - mIRC|on udpread]]
* {{mIRC|/sockread}}
+
* [[on sockwrite - mIRC|on sockwrite]]
* {{mIRC|/sockmark}}
+
* [[$sockerr - Identifiers |$sockerr]]
* {{mIRC|on sockwrite}}
 
* {{mIRC|on sockread}}
 
* {{mIRC|$sockerr}}
 
* {{mIRC|$sock|$sock()}}
 
 
 
 
{{mIRC command list}}
 
{{mIRC command list}}
  
[[Category:mIRC commands|sockwrite command - mIRC]]
+
[[Category:MIRC commands]]

Please note that all contributions to WikiChip may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see WikiChip:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)