From WikiChip
Difference between revisions of "mirc/identifiers/$sock"
< mirc‎ | identifiers

(Created page with "{{mirc title|$sock identifier}}'''$sock''' returns informations about currently opened sockets. == Synopsis == <pre>$sock(name,N)</pre> == Parameters == * '''name''' - The...")
 
(Properties)
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{mirc title|$sock identifier}}'''$sock''' returns informations about currently opened sockets.
+
{{mirc title|$sock identifier}}'''$sock''' returns information about currently opened sockets.
  
  
Line 6: Line 6:
  
 
== Parameters ==
 
== Parameters ==
* '''name''' - The name of the socket, you can use a wildcard expression and use the N parameter to get the Nth socket
+
* '''name''' - The name of the socket, you can use a {{mirc|wildcard}} expression and use the N parameter to get the Nth socket
* '''N''' - The Nth matching socket, to be used with a wildcard expression, default to 1
+
* '''N''' - The Nth matching socket, to be used with a {{mirc|wildcard}} expression, default to 1
  
 
== Properties ==
 
== Properties ==
Line 14: Line 14:
 
* '''.sent''' - returns the number of bytes sent over that connection so far
 
* '''.sent''' - returns the number of bytes sent over that connection so far
 
* '''.rcvd''' - returns the number of bytes received over that connection so far
 
* '''.rcvd''' - returns the number of bytes received over that connection so far
 +
* '''.ip''' - returns the IP Address the socket is connected to.
 +
* '''.port''' - returns the Port the socket is connected to.
 
* '''.sq''' - returns the number of bytes queued in the send buffer
 
* '''.sq''' - returns the number of bytes queued in the send buffer
 
* '''.rq''' - returns the number of bytes queued in the receive buffer
 
* '''.rq''' - returns the number of bytes queued in the receive buffer
Line 28: Line 30:
 
* '''.pause''' - returns $true if a socket has been paused
 
* '''.pause''' - returns $true if a socket has been paused
 
* '''.starttls''' - returns $true for a STARTTLS connection
 
* '''.starttls''' - returns $true for a STARTTLS connection
* '''bindip''' - returns the ip address or adapter name used when binding IP
+
* '''.bindip''' - returns the ip address or adapter name used when binding IP
 
* '''.bindport''' - returns the port name used when binding IP
 
* '''.bindport''' - returns the port name used when binding IP
 +
* '''.status''' - returns the status of the socket "listening", "active", "connecting", or "inactive"
 +
* '''.upnp''' - return $true or $false depending on if upnp was used on the socket
  
 
== Example ==
 
== Example ==

Revision as of 01:48, 15 September 2022

$sock returns information about currently opened sockets.


Synopsis

$sock(name,N)

Parameters

  • name - The name of the socket, you can use a wildcard expression and use the N parameter to get the Nth socket
  • N - The Nth matching socket, to be used with a wildcard expression, default to 1

Properties

  • .name - returns the name you give to a connection to identify it
  • .addr - returns the original named address if one was used.
  • .sent - returns the number of bytes sent over that connection so far
  • .rcvd - returns the number of bytes received over that connection so far
  • .ip - returns the IP Address the socket is connected to.
  • .port - returns the Port the socket is connected to.
  • .sq - returns the number of bytes queued in the send buffer
  • .rq - returns the number of bytes queued in the receive buffer
  • .ls - returns the number of seconds since the connection last sent data
  • .lr - returns the number of seconds since the connection last received data
  • .mark - returns the data marked from /sockmark (data storage tied to the socket, 512 bytes max)
  • .type - returns the socket type, TCP or UDP
  • .saddr - returns the source address of the last received UDP packet
  • .sport - return the source port of the last received UDP packet
  • .to - returns the number of seconds the socket has been open
  • .wserr - returns the last winsock error number that occurred on a socket
  • .wsmsg - returns the last winsock error message corresponding to the .wserr error number above
  • .ssl - returns $true for an SSL connection
  • .pause - returns $true if a socket has been paused
  • .starttls - returns $true for a STARTTLS connection
  • .bindip - returns the ip address or adapter name used when binding IP
  • .bindport - returns the port name used when binding IP
  • .status - returns the status of the socket "listening", "active", "connecting", or "inactive"
  • .upnp - return $true or $false depending on if upnp was used on the socket

Example

//echo -a $sock(*,1)

Compatibility

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.


See also

[Expand]
v · d · e mIRC identifier list