NAME
Net::SixXS::TIC::Server::AnyEvent
- a TIC server using the AnyEvent framework
SYNOPSIS
use Net::SixXS::Data::Tunnel;
use Net::SixXS::Server::AnyEvent;
my %tunnels = (
T00001 => Net::SixXS::Data::Tunnel->from_json(\%data1),
T00002 => Net::SixXS::Data::Tunnel->from_json(\%data2),
);
my $s = Net::SixXS::Server::AnyEvent->new(username => 'user',
password => 'secret', tunnels => \%tunnels);
$s->run;
DESCRIPTION
The Net::SixXS::TIC::Server::AnyEvent
class implements a TIC server providing the data about one or more IPv6-over-IPv4 tunnels running the "Anything-In-Anything" (AYIYA) protocol as used by SixXS. It provides the communication with the clients - receiving command lines and sending back the responses - needed by the Net::SixXS::TIC::Server class, and depends on the latter for the actual implementation of the TIC negotiation.
ATTRIBUTES
The Net::SixXS::TIC::Server::AnyEvent
class defines the following attributes in addition to the ones provided by Net::SixXS::TIC::Server:
host
-
The name or address on which to listen for incoming TIC connections (defaults to "0.0.0.0").
port
-
The port on which to listen for incoming TIC connections (defaults to 3874).
tic_s_asocket
-
After the
run()
method is invoked, this is the AnyEvent::Socket that the server listens on for incoming TIC connections.
METHODS
The Net::SixXS::TIC::Server::AnyEvent
class defines the following methods in addition to the ones provided by Net::SixXS::TIC::Server:
- run ()
-
Create an AnyEvent::Socket listening TCP socket on the specified address and port and prepare to process any incoming connections using the TIC protocol, calling the methods provided by Net::SixXS::TIC::Server to handle the actual commands.
- client_write_line (client, line)
-
Implement the
client_write_line()
method required by Net::SixXS::TIC::Server by pushing the text line into the write buffer of the AnyEvent::Handle client connection. - client_read (id, handle, line, eol)
-
Internal method; handle an incoming text line from the TIC client by passing it on to the
run_command()
method of Net::SixXS::TIC::Server. - push_client_read (id)
-
Internal method; schedule the
client_read()
method to be invoked for incoming text lines on the TIC client's AnyEvent::Handle connection.
SEE ALSO
Net::SixXS, Net::SixXS::Data::Tunnel, Net::SixXS::TIC::Server, Net::SixXS::TIC::Server::Inetd
LICENSE
Copyright (C) 2015 Peter Pentchev <roam@ringlet.net>.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHOR
Peter Pentchev <roam@ringlet.net>