Actions
Added in 1.9.0
$sockbr
Returns the number of bytes read during a on SOCKREAD event.
Example
; Open a socket connection to 'google.com' port '80'.
/sockopen Example www.google.com 80
; Listen for the on SOCKOPEN event.
on *:SOCKOPEN:Example:{
; Write a GET request.
sockwrite -nt $sockname GET / HTTP/1.0
sockwrite -n $sockname
}
; Listen for the on SOCKREAD event.
on *:SOCKREAD:Example:{
; Create a local variable to hold the data.
var %i
; Read the data waiting into the local variable.
sockread %i
; Print number of bytes read.
echo -ag Read $sockbr bytes.
; Close the connection.
sockclose $sockname
}
Updated by Per Amundsen about 10 years ago · 1 revisions