From WikiChip
Difference between revisions of "mirc/identifiers/$sock"
m (→Properties: Add missing .status, also correct typos.) |
m (→See also: Correct typo) |
||
(One intermediate revision by one other user not shown) | |||
Line 33: | Line 33: | ||
* '''.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" | * '''.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 == | ||
Line 43: | Line 44: | ||
* {{mIRC|/sockopen}} | * {{mIRC|/sockopen}} | ||
* {{mIRC|/sockwrite}} | * {{mIRC|/sockwrite}} | ||
− | * {{mIRC| | + | * {{mIRC|$sockerr}} |
* {{mIRC|$sockbr}} | * {{mIRC|$sockbr}} | ||
{{mIRC identifier list}} | {{mIRC identifier list}} | ||
[[Category:mIRC identifiers]] | [[Category:mIRC identifiers]] |
Latest revision as of 21:32, 25 January 2024
Commands & Identifiers
Basics
Events
Matching Tools
Data Storage
Control Structures
GUI Scripting
Sockets
Advanced Scripting
Additional Resources
Security
Other
$sock returns information about currently opened sockets.
Synopsis[edit]
$sock(name,N)
Parameters[edit]
- 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[edit]
- .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[edit]
//echo -a $sock(*,1)
Compatibility[edit]
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[edit]
mIRC identifier list