Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixed Mojo::IOLoop::Server formatting
  • Loading branch information
kraih committed Sep 8, 2013
1 parent 27e0949 commit f3ad746
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions lib/Mojo/IOLoop/Server.pm
Expand Up @@ -39,6 +39,12 @@ sub DESTROY {
$reactor->remove($_) for values %{$self->{handles}};
}

sub generate_port {
IO::Socket::INET->new(Listen => 5, LocalAddr => '127.0.0.1')->sockport;
}

sub handle { shift->{handle} }

sub listen {
my $self = shift;
my $args = ref $_[0] ? $_[0] : {@_};
Expand Down Expand Up @@ -97,12 +103,6 @@ sub listen {
= defined $args->{tls_verify} ? $args->{tls_verify} : 0x03;
}

sub generate_port {
IO::Socket::INET->new(Listen => 5, LocalAddr => '127.0.0.1')->sockport;
}

sub handle { shift->{handle} }

sub start {
my $self = shift;
weaken $self;
Expand Down Expand Up @@ -218,6 +218,18 @@ global L<Mojo::IOLoop> singleton.
L<Mojo::IOLoop::Server> inherits all methods from L<Mojo::EventEmitter> and
implements the following new ones.
=head2 generate_port
my $port = $server->generate_port;
Find a free TCP port, this is a utility function primarily used for tests.
=head2 handle
my $handle = $server->handle;
Get handle for server.
=head2 listen
$server->listen(port => 3000);
Expand Down Expand Up @@ -286,18 +298,6 @@ TLS verification mode, defaults to C<0x03>.
=back
=head2 generate_port
my $port = $server->generate_port;
Find a free TCP port, this is a utility function primarily used for tests.
=head2 handle
my $handle = $server->handle;
Get handle for server.
=head2 start
$server->start;
Expand Down

0 comments on commit f3ad746

Please sign in to comment.