NAME

Tailscale::TcpListener - listen for TCP connections on a Tailscale node

SYNOPSIS

my $listener = $ts->tcp_listen(8080);

while (my $stream = $listener->accept()) {
    my $data = $stream->recv(4096);
    $stream->send_all($data);    # echo
    $stream->close();
}

$listener->close();

DESCRIPTION

A TCP listener bound to a port on a Tailscale node's address. You do not construct this directly; it is returned by "tcp_listen" in Tailscale.

METHODS

accept

my $stream = $listener->accept();

Blocks until an incoming connection arrives and returns it as a Tailscale::TcpStream. Dies on error.

close

$listener->close();

Stops listening and releases the underlying handle. Also called automatically when the object is destroyed.

SEE ALSO

Tailscale, Tailscale::TcpStream

AUTHOR

Brad Fitzpatrick <brad@danga.com>

LICENSE

BSD-3-Clause