| 1 | package POEx::IRC::Backend::Role::HasEndpoint; | ||
| 2 | 3 | $POEx::IRC::Backend::Role::HasEndpoint::VERSION = '0.030002'; | |
| 3 | 3 | ▶ | use Moo::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 3 | has addr => ( | |
| 6 | required => 1, | ||
| 7 | is => 'ro', | ||
| 8 | ); | ||
| 9 | |||
| 10 | 3 | has port => ( | |
| 11 | required => 1, | ||
| 12 | is => 'ro', | ||
| 13 | writer => 'set_port', | ||
| 14 | ); | ||
| 15 | |||
| 16 | 3 | 1; | |
| 17 | |||
| 18 | =pod | ||
| 19 | |||
| 20 | =for Pod::Coverage has_\w+ | ||
| 21 | |||
| 22 | =head1 NAME | ||
| 23 | |||
| 24 | POEx::IRC::Backend::Role::HasEndpoint | ||
| 25 | |||
| 26 | =head1 DESCRIPTION | ||
| 27 | |||
| 28 | This role is consumed by L<POEx::IRC::Backend::Connector> and | ||
| 29 | L<POEx::IRC::Backend::Listener> objects; it defines some basic attributes | ||
| 30 | shared by listening/connecting sockets. | ||
| 31 | |||
| 32 | =head2 addr | ||
| 33 | |||
| 34 | The connecting/listening socket endpoint address. | ||
| 35 | |||
| 36 | =head2 port | ||
| 37 | |||
| 38 | The connecting/listening socket endpoint port. | ||
| 39 | |||
| 40 | =head2 set_port | ||
| 41 | |||
| 42 | Change the current port attribute. | ||
| 43 | |||
| 44 | This won't trigger any automatic Wheel changes (at this time), | ||
| 45 | but it is useful when creating a Listener on port 0 and updating your | ||
| 46 | Listener's state accordingly. | ||
| 47 | |||
| 48 | =head1 AUTHOR | ||
| 49 | |||
| 50 | Jon Portnoy <avenj@cobaltirc.org> | ||
| 51 | |||
| 52 | =cut | ||