Table of Contents

Synopsis:

on [<modes>]dcc_raw [<serial#>] [-|^]<match> { <action> }

Description:

This hook is triggered whenever the client receives a raw message about a tcp connection established, or a connection attempt, with $connect(). Raw messages are sent across established tcp connections with DCC RAW.

Scripts that use sockets should always set a non-zero serial number for it. Otherwise, it is very easy to set confusing or conflicting hooks. Each specific instance of a socket application should use a separate serial number, to prevent conflicts.

Parameters:

$0 File descriptor for connection (returned by $connect())
$1 Host connected to (hostname or ip address)
$2 Code for connection type:
c - DCC RAW connection has closed
d - DCC RAW connection has incoming data
e - DCC RAW nonblocking connect completed successfully.
n - $listen() connection has spawned a new DCC RAW connection
$3- c - not provided
d - incoming data
e - outgoing connection port number
n - incoming connection port number

Default Action:

If you don't suppress this event, the client will display a message to your screen.

Examples:

To display all successful socket connections:

 on #-dcc_raw 10 "% % e %" (fd, host, type, port) {
    xecho -b Connection with $host on port $port \(fd: $fd\)
 }

History: