The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

DBGp::Client::Listener - wait for incoming DBGp connections

SYNOPSIS

    $listener = DBGp::Client::Listener->new(
        port    => 9000,
    );
    $listener->listen;

    $connection = $listener->accept;

    # use the methods in the DBGp::Client::Connection object

DESCRIPTION

The main entry point for DBGp::Client: listens for incoming debugger connections and returns a DBGp::Client::Connection object.

METHODS

new

    my $listener = DBGp::Client::Listener->new(%opts);

Possible options are port to specify a TCP port, and path to specify the path for an Unix-domain socket.

For Unix-domain socket, passing mode performs an additional chmod call before starting to listen for connections.

listen

    $listener->listen;

Starts listening on the endpoint specified to the constructor; die()s if there is an error.

accept

    my $connection = $listener->accept;

Waits for an incoming debugger connection and returns a fully-initialized DBGp::Client::Connection object; it calls "parse_init" in DBGp::Client::Connection on the connection object to read and parse the initialization message.

AUTHOR

Mattia Barbon <mbarbon@cpan.org>

LICENSE

Copyright (c) 2015 Mattia Barbon. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.