Agent

 view release on metacpan or  search on metacpan

Agent/Transport/TCP.pm  view on Meta::CPAN


=item This package groks the following standard tcp/ip formats:

 aaa.bbb.ccc.ddd:port
 host.domain:port

=back

=head1 CONSTRUCTOR

=over 4

=item new( %args )

If the I<Cycle> argument is passed and if new() cannot capture the port
specified, it will cycle through port numbers until a free port is found.
If C<new> is not passed an I<Address> at all, it assumes '127.0.0.1:24368',
and sets I<Cycle> to 1.

=back

=head1 METHODS & SUBS

This module contains all of the Agent::Transport standard methods.  Some
non-standard features have also been introduced:

=over 4

=item $self->accept( %args )

This method is analagous to the accept() function call and is introduced to
allow agent programmers to make full use of bi-directional sockets.  It
simply opens an incoming connection and returns that object, thus allowing
you to use a single connection for multiple messages (see C<IO::Socket> for
details).  Unfortunately, you'll have to design your own protocol.

Passing a 'From' argument as a referenced scalar, causes accept() to put
I<what it thinks> the remote address is into this variable.

=item $self->alias()

Returns $self->address() only.  It should really do hostname lookups.

=item $self->recv( %args )

Passing a 'From' argument as a referenced scalar, causes recv() to put
I<what it thinks> the remote address is into this variable.  Otherwise,
recv() functions as described in I<Agent::Transport>.

=item send( %args )

If you pass send() a 'KeepAlive' argument containing a I<reference> to a
scalar, it will set this scalar to the remote I<socket filehandle>.  This is
meant to be used in conjunction with accept(), and is useful if you would
like to have an extended conversation with the remote host.

=back

=head1 NOTES

This module only binds to a specified address.  If you have multiple
interface addresses (ie: eth0 & eth1), and you want to listen on more than
one, you have to bind each seperately.

=head1 SEE ALSO

C<Agent> C<Agent::Transport>

=head1 AUTHOR

Steve Purkis E<lt>F<spurkis@engsoc.carleton.ca>E<gt>

=head1 COPYRIGHT

Copyright (c) 1998 Steve Purkis. All rights reserved. This program is free
software; you can redistribute it and/or modify it under the same terms as
Perl itself.

=head1 THANKS

Various people from the perl5-agents mailing list.

=cut
v



( run in 2.289 seconds using v1.01-cache-2.11-cpan-2398b32b56e )