.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" 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 >0, 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 .\" ======================================================================== .\" .IX Title "Net::Proxy::Connector 3pm" .TH Net::Proxy::Connector 3pm "2023-06-26" "perl v5.36.0" "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" Net::Proxy::Connector \- Base class for Net::Proxy protocols .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 4 \& # \& # template for the zlonk connector \& # \& package Net::Proxy::Connector::zlonk; \& \& use strict; \& use Net::Proxy::Connector; \& our @ISA = qw( Net::Proxy::Connector ); \& \& # here are the methods you need to write for your connector \& \& # if it can be used as an \*(Aqin\*(Aq connector \& sub listen { } \& sub accept_from { } \& \& # if it can be used as an \*(Aqout\*(Aq connector \& sub connect { } \& \& # to process data \& sub read_from { } \& sub write_to { } \& \& 1; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Net::Proxy::Connector is the base class for all specialised protocols used by Net::Proxy. .SH "METHODS" .IX Header "METHODS" .SS "Class methods" .IX Subsection "Class methods" The base class provides the following methods: .PP \fInew\fR .IX Subsection "new" .PP The constructor. .SS "Instance methods" .IX Subsection "Instance methods" \fIset_proxy\fR .IX Subsection "set_proxy" .PP .Vb 1 \& $connector\->set_proxy( $proxy ); .Ve .PP Define the proxy that \*(L"owns\*(R" the connector. .PP \fIget_proxy\fR .IX Subsection "get_proxy" .PP .Vb 1 \& my $proxy = $connector\->get_proxy(); .Ve .PP Return the Net::Proxy object that \*(L"owns\*(R" the connector. .PP \fIis_in\fR .IX Subsection "is_in" .PP .Vb 1 \& $connector\->is_in(); .Ve .PP Return a boolean value indicating if the Net::Proxy::Connector object is the \f(CW\*(C`in\*(C'\fR connector of its proxy. .PP \fIis_out\fR .IX Subsection "is_out" .PP .Vb 1 \& $connector\->is_out(); .Ve .PP Return a boolean value indicating if the Net::Proxy::Connector object is the \f(CW\*(C`out\*(C'\fR connector of its proxy. .PP \fInew_connection_on\fR .IX Subsection "new_connection_on" .PP .Vb 1 \& $connector\->new_connection_on( $socket ); .Ve .PP This method is called by Net::Proxy to handle incoming connections, and in turn call \f(CW\*(C`accept_from()\*(C'\fR on the 'in' connector and \&\f(CW\*(C`connect()\*(C'\fR on the 'out' connector. .PP \fIraw_read_from\fR .IX Subsection "raw_read_from" .PP .Vb 1 \& my $data = $connector\->raw_read_from( $socket ); .Ve .PP This method can be used by Net::Proxy::Connector subclasses in their \&\f(CW\*(C`read_from()\*(C'\fR methods, to fetch raw data on a socket. .PP \fIraw_write_to\fR .IX Subsection "raw_write_to" .PP .Vb 1 \& $connector\->raw_write_to( $socket, $data ); .Ve .PP This method can be used by Net::Proxy::Connector subclasses in their \&\f(CW\*(C`write_to()\*(C'\fR methods, to send raw data on a socket. .PP \fIraw_listen\fR .IX Subsection "raw_listen" .PP .Vb 1 \& my $sock = $connector\->raw_listen(); .Ve .PP This method can be used by Net::Proxy::Connector subclasses in their \&\f(CW\*(C`listen()\*(C'\fR methods, to create a listening socket on their \f(CW\*(C`host\*(C'\fR and \f(CW\*(C`port\*(C'\fR parameters. .PP \fIraw_accept_from\fR .IX Subsection "raw_accept_from" .PP .Vb 1 \& my $sock = $connector\->raw_accept_from( $socket ); .Ve .PP This method can be used internaly by Net::Proxy::Connector subclasses in their \f(CW\*(C`accept_from()\*(C'\fR methods, to accept a newly connected socket. .SH "SUBCLASS METHODS" .IX Header "SUBCLASS METHODS" The following methods should be defined in Net::Proxy::Connector subclasses: .SS "Initialisation" .IX Subsection "Initialisation" \fIinit\fR .IX Subsection "init" .PP .Vb 1 \& $connector\->init; .Ve .PP This method initalizes the connector. .SS "Processing incoming/outgoing data" .IX Subsection "Processing incoming/outgoing data" \fIread_from\fR .IX Subsection "read_from" .PP .Vb 1 \& my $data = $connector\->read_from( $socket ); .Ve .PP Return the data that was possibly decapsulated by the connector. .PP \fIwrite_to\fR .IX Subsection "write_to" .PP .Vb 1 \& $connector\->write_to( $socket, $data ); .Ve .PP Write \f(CW$data\fR to the given \f(CW$socket\fR, according to the connector scheme. .ie n .SS """in"" connector" .el .SS "\f(CWin\fP connector" .IX Subsection "in connector" \fIlisten\fR .IX Subsection "listen" .PP .Vb 1 \& my $sock = $connector\->listen(); .Ve .PP Initiate listening sockets and return them. .PP This method can use the \f(CW\*(C`raw_listen()\*(C'\fR method to do the low-level listen call. .PP \fIaccept_from\fR .IX Subsection "accept_from" .PP .Vb 1 \& my $sock = $connector\->accept_from( $socket ); .Ve .PP \&\f(CW$socket\fR is a listening socket created by \f(CW\*(C`listen()\*(C'\fR. This method returns the connected socket. .PP This method can use the \f(CW\*(C`raw_accept_from()\*(C'\fR method to do the low-level accept call. .ie n .SS """out"" connector" .el .SS "\f(CWout\fP connector" .IX Subsection "out connector" \fIconnect\fR .IX Subsection "connect" .PP .Vb 1 \& my $sock = $connector\->connect(); .Ve .PP Return a socket connected to the remote server. .SH "AUTHOR" .IX Header "AUTHOR" Philippe 'BooK' Bruhat, \f(CW\*(C`\*(C'\fR. .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright 2006\-2014 Philippe 'BooK' Bruhat, All Rights Reserved. .SH "LICENSE" .IX Header "LICENSE" This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.