=head1 NAME

APR::Socket - Perl API for XXX




=head1 Synopsis

  use APR::Socket ();

META: to be completed




=head1 Description

META: to be completed




=head1 API

C<APR::Socket> provides the following functions and/or methods:




=head2 C<bind>

META: Autogenerated - needs to be reviewed/completed

Bind the socket to its associated port

  $ret = $sock->bind($sa);

=over 4

=item arg1: C<$sock> (C<L<APR::Socket|docs::2.0::api::APR::Socket>>)

The socket to bind

=item arg2: C<$sa> (C<L<APR::SockAddr|docs::2.0::api::APR::SockAddr>>)

The socket address to bind to

=item ret: C<$ret> (integer)



=back

This may be where we will find out if there is any other process
using the selected port.



=head2 C<close>

META: Autogenerated - needs to be reviewed/completed

Close a socket.

  $ret = $thesocket->close();

=over 4

=item arg1: C<$thesocket> (C<L<APR::Socket|docs::2.0::api::APR::Socket>>)

The socket to close

=item ret: C<$ret> (integer)



=back





=head2 C<connect>

META: Autogenerated - needs to be reviewed/completed

Issue a connection request to a socket either on the same machine
or a different one.

  $ret = $sock->connect($sa);

=over 4

=item arg1: C<$sock> (C<L<APR::Socket|docs::2.0::api::APR::Socket>>)

The socket we wish to use for our side of the connection 

=item arg2: C<$sa> (C<L<APR::SockAddr|docs::2.0::api::APR::SockAdrr>>)

The address of the machine we wish to connect to.  If NULL,
APR assumes that the sockaddr_in in the apr_socket is
completely filled out.

=item ret: C<$ret> (integer)



=back





=head2 C<listen>

META: Autogenerated - needs to be reviewed/completed

Listen to a bound socket for connections.

  $ret = $sock->listen($backlog);

=over 4

=item arg1: C<$sock> (C<L<APR::Socket|docs::2.0::api::APR::Socket>>)

The socket to listen on 

=item arg2: C<$backlog> (integer)

The number of outstanding connections allowed in the sockets
listen queue.  If this value is less than zero, the listen
queue size is set to zero.

=item ret: C<$ret> (integer)



=back





=head2 C<opt_get>

META: Autogenerated - needs to be reviewed/completed

Query socket options for the specified socket

  $ret = $sock->opt_get($opt, $on);

=over 4

=item arg1: C<$sock> (C<L<APR::Socket|docs::2.0::api::APR::Socket>>)

The socket to query

=item arg2: C<$opt> (integer)

The option we would like to query.  One of:

  APR::SO_DEBUG        -- turn on debugging information
  APR::SO_KEEPALIVE    -- keep connections active
  APR::SO_LINGER       -- lingers on close if data is present
  APR::SO_NONBLOCK     -- Turns blocking on/off for socket
  APR::SO_REUSEADDR    -- The rules used in validating addresses
                          supplied to bind should allow reuse
                          of local addresses.
  APR::SO_SNDBUF       -- Set the SendBufferSize
  APR::SO_RCVBUF       -- Set the ReceiveBufferSize
  APR::SO_DISCONNECTED -- Query the disconnected state of the socket.
                          (Currently only used on Windows)


=item arg3: C<$on> (integer)

Socket option returned on the call.

=item ret: C<$ret> (integer)



=back





=head2 C<opt_set>

META: Autogenerated - needs to be reviewed/completed

Setup socket options for the specified socket

  $ret = $sock->opt_set($opt, $on);

=over 4

=item arg1: C<$sock> (C<L<APR::Socket|docs::2.0::api::APR::Socket>>)

The socket to set up.

=item arg2: C<$opt> (integer)

The option we would like to configure.  One of:

  APR::SO_DEBUG     -- turn on debugging information
  APR::SO_KEEPALIVE -- keep connections active
  APR::SO_LINGER    -- lingers on close if data is present
  APR::SO_NONBLOCK  -- Turns blocking on/off for socket
  APR::SO_REUSEADDR -- The rules used in validating addresses
                       supplied to bind should allow reuse of local
                       addresses.
  APR::SO_SNDBUF    -- Set the SendBufferSize
  APR::SO_RCVBUF    -- Set the ReceiveBufferSize

=item arg3: C<$on> (integer)

Value for the option.

=item ret: C<$ret> (integer)



=back





=head2 C<recvfrom>

META: Autogenerated - needs to be reviewed/completed



  $ret = $from->recvfrom($sock, $flags, $buf, $len);

=over 4

=item arg1: C<$from> (C<L<APR::SockAddr|docs::2.0::api::APR::SockAddr>>)

The apr_sockaddr_t to fill in the recipient info

=item arg2: C<$sock> (C<L<APR::SockAddr|docs::2.0::api::APR::SockAddr>>)

The socket to use

=item arg3: C<$flags> (integer)

The flags to use

=item arg4: C<$buf> (integer)

The buffer to use

=item arg5: C<$len> (string)

The length of the available buffer

=item ret: C<$ret> (integer)



=back





=head2 C<sendto>

META: Autogenerated - needs to be reviewed/completed



  $ret = $sock->sendto($where, $flags, $buf, $len);

=over 4

=item arg1: C<$sock> (C<L<APR::Socket|docs::2.0::api::APR::Socket>>)

The socket to send from

=item arg2: C<$where> (C<L<APR::Socket|docs::2.0::api::APR::Socket>>)

The apr_sockaddr_t describing where to send the data

=item arg3: C<$flags> (integer)

The flags to use

=item arg4: C<$buf> (scalar)

The data to send

=item arg5: C<$len> (string)

The length of the data to send

=item ret: C<$ret> (integer)



=back





=head2 C<timeout_set>

META: Autogenerated - needs to be reviewed/completed

Setup socket timeout for the specified socket

  $ret = $sock->timeout_set($t);

=over 4

=item arg1: C<$sock> (C<L<APR::Socket|docs::2.0::api::APR::Socket>>)

The socket to set up.

=item arg2: C<$t> (number)

Value for the timeout:

   t > 0  -- read and write calls return APR::TIMEUP if specified time
             elapsess with no data read or written
   t == 0 -- read and write calls never block
   t < 0  -- read and write calls block

=item ret: C<$ret> (integer)



=back




=head1 See Also

L<mod_perl 2.0 documentation|docs::2.0::index>.




=head1 Copyright

mod_perl 2.0 and its core modules are copyrighted under
The Apache Software License, Version 1.1.




=head1 Authors

L<The mod_perl development team and numerous
contributors|about::contributors::people>.

=cut

