.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "POE::Component::IRC::Plugin::DCC 3pm" .TH POE::Component::IRC::Plugin::DCC 3pm "2014-06-28" "perl v5.18.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" POE::Component::IRC::Plugin::DCC \- A PoCo\-IRC plugin providing support for DCC transfers .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 4 \& # send a file \& my $file = \*(Aq/home/user/secret.pdf\*(Aq; \& my $recipient = \*(Aqthat_guy\*(Aq; \& $irc\->yield(dcc => $recipient => SEND => $file); \& \& # receive a file \& sub irc_dcc_request { \& my ($user, $type, $port, $cookie, $file, $size, $addr) = @_[ARG0..$#_]; \& return if $type ne \*(AqSEND\*(Aq; \& \& my $irc = $_[SENDER]\->get_heap(); \& my $nick = (split /!/, $user)[0]; \& \& print "$nick wants to send me \*(Aq$file\*(Aq ($size bytes) from $addr:$port\en"); \& $irc\->yield(dcc_accept => $cookie); \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This plugin provides the \s-1IRC\s0 commands needed to make use of \s-1DCC.\s0 It is used internally by POE::Component::IRC so there's no need to add it manually. .SH "METHODS" .IX Header "METHODS" .ie n .SS """new""" .el .SS "\f(CWnew\fP" .IX Subsection "new" Takes no arguments. .PP Returns a plugin object suitable for feeding to POE::Component::IRC's \f(CW\*(C`plugin_add\*(C'\fR method. .ie n .SS """dccports""" .el .SS "\f(CWdccports\fP" .IX Subsection "dccports" Sets the \s-1TCP\s0 ports that can be used for \s-1DCC\s0 sends. Takes one argument, an arrayref containing the port numbers. .ie n .SS """nataddr""" .el .SS "\f(CWnataddr\fP" .IX Subsection "nataddr" Sets the public \s-1NAT\s0 address to be used for \s-1DCC\s0 sends. .ie n .SS """dcc_info""" .el .SS "\f(CWdcc_info\fP" .IX Subsection "dcc_info" Takes one argument, a \s-1DCC\s0 connection id (see below). Returns a hash of information about the connection. The keys are: \fB'nick'\fR, \fB'type'\fR, \&\fB'port'\fR, \fB'file'\fR, \fB'size'\fR, \fB'done,'\fR, and \fB'peeraddr'\fR. .SH "COMMANDS" .IX Header "COMMANDS" The plugin responds to the following POE::Component::IRC commands. .ie n .SS """dcc""" .el .SS "\f(CWdcc\fP" .IX Subsection "dcc" Send a \s-1DCC SEND\s0 or \s-1CHAT\s0 request to another person. Takes at least two arguments: the nickname of the person to send the request to and the type of \s-1DCC\s0 request (\s-1SEND\s0 or \s-1CHAT\s0). For \s-1SEND\s0 requests, be sure to add a third argument for the filename you want to send. Optionally, you can add a fourth argument for the \s-1DCC\s0 transfer blocksize, but the default of 1024 should usually be fine. The fifth (and optional) argument is the request timeout value in seconds (default: 300). .PP Incidentally, you can send other weird nonstandard kinds of DCCs too; just put something besides '\s-1SEND\s0' or '\s-1CHAT\s0' (say, '\s-1FOO\s0') in the type field, and you'll get back \f(CW\*(C`irc_dcc_foo\*(C'\fR events (with the same arguments as \&\f(CW\*(C`irc_dcc_chat\*(C'\fR) when data arrives on its \s-1DCC\s0 connection. .PP If you are behind a firewall or Network Address Translation, you may want to consult POE::Component::IRC's \&\f(CW\*(C`connect\*(C'\fR for some parameters that are useful with this command. .ie n .SS """dcc_accept""" .el .SS "\f(CWdcc_accept\fP" .IX Subsection "dcc_accept" Accepts an incoming \s-1DCC\s0 connection from another host. First argument: the magic cookie from an \f(CW\*(C`irc_dcc_request\*(C'\fR event. In the case of a \s-1DCC GET,\s0 the second argument can optionally specify a new name for the destination file of the \s-1DCC\s0 transfer, instead of using the sender's name for it. (See the \f(CW\*(C`irc_dcc_request\*(C'\fR section below for more details.) .ie n .SS """dcc_resume""" .el .SS "\f(CWdcc_resume\fP" .IX Subsection "dcc_resume" Resumes a \s-1DCC SEND\s0 file transfer. First argument: the magic cookie from an \&\f(CW\*(C`irc_dcc_request\*(C'\fR event. An optional second argument provides the name of the file to which you want to write. .ie n .SS """dcc_chat""" .el .SS "\f(CWdcc_chat\fP" .IX Subsection "dcc_chat" Sends lines of data to the person on the other side of a \s-1DCC CHAT\s0 connection. The first argument should be the wheel id of the connection which you got from an \f(CW\*(C`irc_dcc_start\*(C'\fR event, followed by all the data you wish to send (it'll be separated with newlines for you). .ie n .SS """dcc_close""" .el .SS "\f(CWdcc_close\fP" .IX Subsection "dcc_close" Terminates a \s-1DCC SEND\s0 or \s-1GET\s0 connection prematurely, and causes \s-1DCC CHAT\s0 connections to close gracefully. Takes one argument: the wheel id of the connection which you got from an \f(CW\*(C`irc_dcc_start\*(C'\fR (or similar) event. .SH "OUTPUT EVENTS" .IX Header "OUTPUT EVENTS" .ie n .SS """irc_dcc_request""" .el .SS "\f(CWirc_dcc_request\fP" .IX Subsection "irc_dcc_request" \&\fBNote:\fR This event is actually emitted by POE::Filter::IRC::Compat, but documented here to keep all the \s-1DCC\s0 documentation in one place. In case you were wondering. .PP You receive this event when another \s-1IRC\s0 client sends you a \s-1DCC \&\s0(e.g. \s-1SEND\s0 or \s-1CHAT\s0) request out of the blue. You can examine the request and decide whether or not to accept it (with \f(CW\*(C`dcc_accept\*(C'\fR) here. In the case of \s-1DCC\s0 SENDs, you can also request to resume the file with \&\f(CW\*(C`dcc_resume\*(C'\fR. .PP \&\fBNote:\fR \s-1DCC\s0 doesn't provide a way to explicitly reject requests, so if you don't intend to accept one, just ignore it or send a \&\s-1NOTICE\s0 or \s-1PRIVMSG\s0 to the peer explaining why you're not going to accept. .IP "\(bu" 4 \&\f(CW\*(C`ARG0\*(C'\fR: the peer's nick!user@host .IP "\(bu" 4 \&\f(CW\*(C`ARG1\*(C'\fR: the \s-1DCC\s0 type (e.g. '\s-1CHAT\s0' or '\s-1SEND\s0') .IP "\(bu" 4 \&\f(CW\*(C`ARG2\*(C'\fR: the port which the peer is listening on .IP "\(bu" 4 \&\f(CW\*(C`ARG3\*(C'\fR: this connection's \*(L"magic cookie\*(R" .IP "\(bu" 4 \&\f(CW\*(C`ARG4\*(C'\fR: the file name (\s-1SEND\s0 only) .IP "\(bu" 4 \&\f(CW\*(C`ARG5\*(C'\fR: the file size (\s-1SEND\s0 only) .IP "\(bu" 4 \&\f(CW\*(C`ARG6\*(C'\fR: the \s-1IP\s0 address which the peer is listening on .ie n .SS """irc_dcc_start""" .el .SS "\f(CWirc_dcc_start\fP" .IX Subsection "irc_dcc_start" This event notifies you that a \s-1DCC\s0 connection has been successfully established. .IP "\(bu" 4 \&\f(CW\*(C`ARG0\*(C'\fR: the connection's wheel id .IP "\(bu" 4 \&\f(CW\*(C`ARG1\*(C'\fR: the peer's nickname .IP "\(bu" 4 \&\f(CW\*(C`ARG2\*(C'\fR: the \s-1DCC\s0 type .IP "\(bu" 4 \&\f(CW\*(C`ARG3\*(C'\fR: the port number .IP "\(bu" 4 \&\f(CW\*(C`ARG4\*(C'\fR: the file name (\s-1SEND/GET\s0 only) .IP "\(bu" 4 \&\f(CW\*(C`ARG5\*(C'\fR: the file size (\s-1SEND/GET\s0 only) .IP "\(bu" 4 \&\f(CW\*(C`ARG6\*(C'\fR: the peer's \s-1IP\s0 address .ie n .SS """irc_dcc_chat""" .el .SS "\f(CWirc_dcc_chat\fP" .IX Subsection "irc_dcc_chat" Notifies you that one line of text has been received from the client on the other end of a \s-1DCC CHAT\s0 connection. .IP "\(bu" 4 \&\f(CW\*(C`ARG0\*(C'\fR: the connection's wheel id .IP "\(bu" 4 \&\f(CW\*(C`ARG1\*(C'\fR: the peer's nickname .IP "\(bu" 4 \&\f(CW\*(C`ARG2\*(C'\fR: the port number .IP "\(bu" 4 \&\f(CW\*(C`ARG3\*(C'\fR: the text they sent .IP "\(bu" 4 \&\f(CW\*(C`ARG4\*(C'\fR: the peer's \s-1IP\s0 address .ie n .SS """irc_dcc_get""" .el .SS "\f(CWirc_dcc_get\fP" .IX Subsection "irc_dcc_get" Notifies you that another block of data has been successfully transferred from the client on the other end of your \s-1DCC GET\s0 connection. .IP "\(bu" 4 \&\f(CW\*(C`ARG0\*(C'\fR: the connection's wheel id .IP "\(bu" 4 \&\f(CW\*(C`ARG1\*(C'\fR: the peer's nickname .IP "\(bu" 4 \&\f(CW\*(C`ARG2\*(C'\fR: the port number .IP "\(bu" 4 \&\f(CW\*(C`ARG3\*(C'\fR: the file name .IP "\(bu" 4 \&\f(CW\*(C`ARG4\*(C'\fR: the file size .IP "\(bu" 4 \&\f(CW\*(C`ARG5\*(C'\fR: transferred file size .IP "\(bu" 4 \&\f(CW\*(C`ARG6\*(C'\fR: the peer's \s-1IP\s0 address .ie n .SS """irc_dcc_send""" .el .SS "\f(CWirc_dcc_send\fP" .IX Subsection "irc_dcc_send" Notifies you that another block of data has been successfully transferred from you to the client on the other end of a \s-1DCC SEND\s0 connection. .IP "\(bu" 4 \&\f(CW\*(C`ARG0\*(C'\fR: the connection's wheel id .IP "\(bu" 4 \&\f(CW\*(C`ARG1\*(C'\fR: the peer's nickname .IP "\(bu" 4 \&\f(CW\*(C`ARG2\*(C'\fR: the port number .IP "\(bu" 4 \&\f(CW\*(C`ARG3\*(C'\fR: the file name .IP "\(bu" 4 \&\f(CW\*(C`ARG4\*(C'\fR: the file size .IP "\(bu" 4 \&\f(CW\*(C`ARG5\*(C'\fR: transferred file size .IP "\(bu" 4 \&\f(CW\*(C`ARG6\*(C'\fR: the peer's \s-1IP\s0 address .ie n .SS """irc_dcc_done""" .el .SS "\f(CWirc_dcc_done\fP" .IX Subsection "irc_dcc_done" You receive this event when a \s-1DCC\s0 connection terminates normally. Abnormal terminations are reported by \f(CW\*(C`irc_dcc_error\*(C'\fR. .IP "\(bu" 4 \&\f(CW\*(C`ARG0\*(C'\fR: the connection's wheel id .IP "\(bu" 4 \&\f(CW\*(C`ARG1\*(C'\fR: the peer's nickname .IP "\(bu" 4 \&\f(CW\*(C`ARG2\*(C'\fR: the \s-1DCC\s0 type .IP "\(bu" 4 \&\f(CW\*(C`ARG3\*(C'\fR: the port number .IP "\(bu" 4 \&\f(CW\*(C`ARG4\*(C'\fR: the filename (\s-1SEND/GET\s0 only) .IP "\(bu" 4 \&\f(CW\*(C`ARG5\*(C'\fR: file size (\s-1SEND/GET\s0 only) .IP "\(bu" 4 \&\f(CW\*(C`ARG6\*(C'\fR: transferred file size (\s-1SEND/GET\s0 only) .IP "\(bu" 4 \&\f(CW\*(C`ARG7\*(C'\fR: the peer's \s-1IP\s0 address .ie n .SS """irc_dcc_error""" .el .SS "\f(CWirc_dcc_error\fP" .IX Subsection "irc_dcc_error" You get this event whenever a \s-1DCC\s0 connection or connection attempt terminates unexpectedly or suffers some fatal error. Some of the following values might be undefined depending the stage at which the connection/attempt failed. .IP "\(bu" 4 \&\f(CW\*(C`ARG0\*(C'\fR: the connection's wheel id .IP "\(bu" 4 \&\f(CW\*(C`ARG1\*(C'\fR: the error string .IP "\(bu" 4 \&\f(CW\*(C`ARG2\*(C'\fR: the peer's nickname .IP "\(bu" 4 \&\f(CW\*(C`ARG3\*(C'\fR: the \s-1DCC\s0 type .IP "\(bu" 4 \&\f(CW\*(C`ARG4\*(C'\fR: the port number .IP "\(bu" 4 \&\f(CW\*(C`ARG5\*(C'\fR: the file name .IP "\(bu" 4 \&\f(CW\*(C`ARG6\*(C'\fR: file size in bytes .IP "\(bu" 4 \&\f(CW\*(C`ARG7\*(C'\fR: transferred file size in bytes .IP "\(bu" 4 \&\f(CW\*(C`ARG8\*(C'\fR: the peer's \s-1IP\s0 address .SH "AUTHOR" .IX Header "AUTHOR" Dennis '\f(CW\*(C`fimmtiu\*(C'\fR' Taylor and Hinrik O\*:rn Sigur\*(d-sson, hinrik.sig@gmail.com