/usr/share/doc/libapache2-mod-perl2-doc/docs/2.0/api/APR/Socket.html is in libapache2-mod-perl2-doc 2.0.8+httpd24-r1449661-6ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 | <?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:root@localhost" />
</head>
<body style="background-color: white">
<ul id="index">
<li><a href="#NAME">NAME</a></li>
<li><a href="#Synopsis">Synopsis</a></li>
<li><a href="#Description">Description</a></li>
<li><a href="#API">API</a>
<ul>
<li><a href="#fileno">fileno</a></li>
<li><a href="#opt_get">opt_get</a></li>
<li><a href="#opt_set">opt_set</a></li>
<li><a href="#poll">poll</a></li>
<li><a href="#recv">recv</a></li>
<li><a href="#send">send</a></li>
<li><a href="#timeout_get">timeout_get</a></li>
<li><a href="#timeout_set">timeout_set</a></li>
</ul>
</li>
<li><a href="#Unsupported-API">Unsupported API</a>
<ul>
<li><a href="#bind">bind</a></li>
<li><a href="#close">close</a></li>
<li><a href="#connect">connect</a></li>
<li><a href="#listen">listen</a></li>
<li><a href="#recvfrom">recvfrom</a></li>
<li><a href="#sendto">sendto</a></li>
</ul>
</li>
<li><a href="#See-Also">See Also</a></li>
<li><a href="#Copyright">Copyright</a></li>
<li><a href="#Authors">Authors</a></li>
</ul>
<h1 id="NAME">NAME</h1>
<p>APR::Socket - Perl API for APR sockets</p>
<h1 id="Synopsis">Synopsis</h1>
<pre><code> use APR::Socket ();
### set the socket to the blocking mode if it isn't already
### and read in the loop and echo it back
use APR::Const -compile => qw(SO_NONBLOCK);
if ($sock->opt_get(APR::Const::SO_NONBLOCK)) {
$sock->opt_set(APR::Const::SO_NONBLOCK => 0);
}
# read from/write to the socket (w/o handling possible failures)
my $wanted = 1024;
while ($sock->recv(my $buff, $wanted)) {
$sock->send($buff);
}
### get/set IO timeout and try to read some data
use APR::Const -compile => qw(TIMEUP);
# timeout is in usecs!
my $timeout = $sock->timeout_get();
if ($timeout < 10_000_000) {
$sock->timeout_set(20_000_000); # 20 secs
}
# now read, while handling timeouts
my $wanted = 1024;
my $buff;
my $rlen = eval { $sock->recv($buff, $wanted) };
if ($@ && ref $@ && $@ == APR::Const::TIMEUP) {
# timeout, do something, e.g.
warn "timed out, will try again later";
}
else {
warn "asked for $wanted bytes, read $rlen bytes\n";
# do something with the data
}
# non-blocking io poll
$sock->opt_set(APR::Const::SO_NONBLOCK => 1);
my $rc = $sock->poll($c->pool, 1_000_000, APR::Const::POLLIN);
if ($rc == APR::Const::SUCCESS) {
# read the data
}
else {
# handle the condition
}
# fetch the operating level socket
my $fd=$sock->fileno;</code></pre>
<h1 id="Description">Description</h1>
<p><code>APR::Socket</code> provides the Perl interface to APR sockets.</p>
<h1 id="API">API</h1>
<p><code>APR::Socket</code> provides the following methods:</p>
<h2 id="fileno"><code>fileno</code></h2>
<p>Get the operating system socket, the file descriptor on UNIX.</p>
<pre><code> $fd = $sock->fileno;</code></pre>
<dl>
<dt id="obj:-sock-APR::Socket-object">obj: <code>$sock</code> ( <code><a>APR::Socket object</a></code> )</dt>
<dd>
<p>The socket</p>
</dd>
<dt id="ret:-fd-integer">ret: <code>$fd</code> ( integer )</dt>
<dd>
<p>The OS-level file descriptor.</p>
</dd>
<dt id="since:-2.0.5-not-implemented-on-Windows">since: 2.0.5 (not implemented on Windows)</dt>
<dd>
</dd>
</dl>
<h2 id="opt_get"><code>opt_get</code></h2>
<p>Query socket options for the specified socket</p>
<pre><code> $val = $sock->opt_get($opt);</code></pre>
<dl>
<dt id="obj:-sock-APR::Socket-object1">obj: <code>$sock</code> ( <code><a>APR::Socket object</a></code> )</dt>
<dd>
<p>the socket object to query</p>
</dd>
<dt id="arg1:-opt-APR::Const-constant">arg1: <code>$opt</code> ( <code><a>APR::Const constant</a></code> )</dt>
<dd>
<p>the socket option we would like to configure. Here are the <a>available socket options</a>.</p>
</dd>
<dt id="ret:-val-integer">ret: <code>$val</code> ( integer )</dt>
<dd>
<p>the currently set value for <a>the socket option</a> you've queried for</p>
</dd>
<dt id="excpt:-APR::Error">excpt: <code><a>APR::Error</a></code></dt>
<dd>
</dd>
<dt id="since:-2.0.00">since: 2.0.00</dt>
<dd>
</dd>
</dl>
<p>Examples can be found in <a>the socket options constants section</a>. For example <a>setting the IO to the blocking mode</a>.</p>
<h2 id="opt_set"><code>opt_set</code></h2>
<p>Setup socket options for the specified socket</p>
<pre><code> $sock->opt_set($opt, $val);</code></pre>
<dl>
<dt id="obj:-sock-APR::Socket-object-object">obj: <code>$sock</code> ( <code><a>APR::Socket object</a></code> object )</dt>
<dd>
<p>the socket object to set up.</p>
</dd>
<dt id="arg1:-opt-APR::Const-constant1">arg1: <code>$opt</code> ( <code><a>APR::Const</a></code> constant )</dt>
<dd>
<p>the socket option we would like to configure. Here are the <a>available socket options</a>.</p>
</dd>
<dt id="arg2:-val-integer">arg2: <code>$val</code> ( integer )</dt>
<dd>
<p>value for the option. Refer to the <a>socket options</a> section to learn about the expected values.</p>
</dd>
<dt id="ret:-no-return-value">ret: no return value</dt>
<dd>
</dd>
<dt id="excpt:-APR::Error1">excpt: <code><a>APR::Error</a></code></dt>
<dd>
</dd>
<dt id="since:-2.0.001">since: 2.0.00</dt>
<dd>
</dd>
</dl>
<p>Examples can be found in <a>the socket options constants section</a>. For example <a>setting the IO to the blocking mode</a>.</p>
<h2 id="poll"><code>poll</code></h2>
<p>Poll the socket for events:</p>
<pre><code> $rc = $sock->poll($pool, $timeout, $events);</code></pre>
<dl>
<dt id="obj:-sock-APR::Socket-object2">obj: <code>$sock</code> ( <code><a>APR::Socket object</a></code> )</dt>
<dd>
<p>The socket to poll</p>
</dd>
<dt id="arg1:-pool-APR::Pool-object">arg1: <code>$pool</code> ( <code><a>APR::Pool object</a></code> )</dt>
<dd>
<p>usually <code><a>$c->pool</a></code>.</p>
</dd>
<dt id="arg2:-timeout-integer">arg2: <code>$timeout</code> ( integer )</dt>
<dd>
<p>The amount of time to wait (in milliseconds) for the specified events to occur.</p>
</dd>
<dt id="arg3:-events-APR::Const-:poll-constants">arg3: <code>$events</code> ( <code><a>APR::Const :poll constants</a></code> )</dt>
<dd>
<p>The events for which to wait.</p>
<p>For example use <code><a>APR::Const::POLLIN</a></code> to wait for incoming data to be available, <code><a>APR::Const::POLLOUT</a></code> to wait until it's possible to write data to the socket and <code><a>APR::Const::POLLPRI</a></code> to wait for priority data to become available.</p>
</dd>
<dt id="ret:-rc-APR::Const-constant">ret: <code>$rc</code> ( <code><a>APR::Const constant</a></code> )</dt>
<dd>
<p>If <code>APR::Const::SUCCESS</code> is received than the polling was successful. If not -- the error code is returned, which can be converted to the error string with help of <code><a>APR::Error::strerror</a></code>.</p>
</dd>
<dt id="since:-2.0.002">since: 2.0.00</dt>
<dd>
</dd>
</dl>
<p>For example poll a non-blocking socket up to 1 second when reading data from the client:</p>
<pre><code> use APR::Socket ();
use APR::Connection ();
use APR::Error ();
use APR::Const -compile => qw(SO_NONBLOCK POLLIN SUCCESS TIMEUP);
$sock->opt_set(APR::Const::SO_NONBLOCK => 1);
my $rc = $sock->poll($c->pool, 1_000_000, APR::Const::POLLIN);
if ($rc == APR::Const::SUCCESS) {
# Data is waiting on the socket to be read.
# $sock->recv(my $buf, BUFF_LEN)
}
elsif ($rc == APR::Const::TIMEUP) {
# One second elapsed and still there is no data waiting to be
# read. for example could try again.
}
else {
die "poll error: " . APR::Error::strerror($rc);
}</code></pre>
<h2 id="recv"><code>recv</code></h2>
<p>Read incoming data from the socket</p>
<pre><code> $len = $sock->recv($buffer, $wanted);</code></pre>
<dl>
<dt id="obj:-sock-APR::SockAddr-object-object">obj: <code>$sock</code> ( <code><a>APR::SockAddr object</a></code> object )</dt>
<dd>
<p>The socket to read from</p>
</dd>
<dt id="arg1:-buffer-SCALAR">arg1: <code>$buffer</code> ( SCALAR )</dt>
<dd>
<p>The buffer to fill. All previous data will be lost.</p>
</dd>
<dt id="arg2:-wanted-int">arg2: <code>$wanted</code> ( int )</dt>
<dd>
<p>How many bytes to attempt to read.</p>
</dd>
<dt id="ret:-len-number">ret: <code>$len</code> ( number )</dt>
<dd>
<p>How many bytes were actually read.</p>
<p><code>$buffer</code> gets populated with the string that is read. It will contain an empty string if there was nothing to read.</p>
</dd>
<dt id="excpt:-APR::Error2">excpt: <code><a>APR::Error</a></code></dt>
<dd>
<p>If you get the <code>'(11) Resource temporarily unavailable'</code> error (exception <code><a>APR::Const::EAGAIN</a></code>) (or another equivalent, which might be different on non-POSIX systems), then you didn't ensure that the socket is in <a href="#C_opt_set_">a blocking IO mode</a> before using it. Note that you should use <code><a>APR::Status::is_EAGAIN</a></code> to perform this check (since different error codes may be returned for the same event on different OSes). For example if the socket is set to the non-blocking mode and there is no data right away, you may get this exception thrown. So here is how to check for it and retry a few times after short delays:</p>
<pre><code> use APR::Status ();
$sock->opt_set(APR::Const::SO_NONBLOCK, 1);
# ....
my $tries = 0;
my $buffer;
RETRY: my $rlen = eval { $socket->recv($buffer, SIZE) };
if ($@)
die $@ unless ref $@ && APR::Status::is_EAGAIN($@);
if ($tries++ < 3) {
# sleep 250msec
select undef, undef, undef, 0.25;
goto RETRY;
}
else {
# do something else
}
}
warn "read $rlen bytes\n"</code></pre>
<p>If timeout was set via <code>timeout_set|/C_timeout_set_</code>, you may need to catch the <code><a>APR::Const::TIMEUP</a></code> exception. For example:</p>
<pre><code> use APR::Const -compile => qw(TIMEUP);
$sock->timeout_set(1_000_000); # 1 sec
my $buffer;
eval { $sock->recv($buffer, $wanted) };
if ($@ && $@ == APR::Const::TIMEUP) {
# timeout, do something, e.g.
}</code></pre>
<p>If not handled -- you may get the error <code>'70007: The timeout specified has expired'</code>.</p>
<p>Another error condition that may occur is the <code>'(104) Connection reset by peer'</code> error, which is up to your application logic to decide whether it's an error or not. This error usually happens when the client aborts the connection.</p>
<pre><code> use APR::Const -compile => qw(ECONNABORTED);
my $buffer;
eval { $sock->recv($buffer, $wanted) };
if ($@ == APR::Const::ECONNABORTED) {
# ignore it or deal with it
}</code></pre>
</dd>
<dt id="since:-2.0.003">since: 2.0.00</dt>
<dd>
</dd>
</dl>
<p>Here is the quick prototype example, which doesn't handle any errors (mod_perl will do that for you):</p>
<pre><code> use APR::Socket ();
# set the socket to the blocking mode if it isn't already
use APR::Const -compile => qw(SO_NONBLOCK);
if ($sock->opt_get(APR::Const::SO_NONBLOCK)) {
$sock->opt_set(APR::Const::SO_NONBLOCK => 0);
}
# read from/write to the socket (w/o handling possible failures)
my $wanted = 1024;
while ($sock->recv(my $buffer, $wanted)) {
$sock->send($buffer);
}</code></pre>
<p>If you want to handle errors by yourself, the loop may look like:</p>
<pre><code> use APR::Const -compile => qw(ECONNABORTED);
# ...
while (1) {
my $buf;
my $len = eval { $sock->recv($buf, $wanted) };
if ($@) {
# handle the error, e.g. to ignore aborted connections but
# rethrow any other errors:
if ($@ == APR::Const::ECONNABORTED) {
# ignore
last;
}
else {
die $@; # retrow
}
}
if ($len) {
$sock->send($buffer);
}
else {
last;
}
}</code></pre>
<h2 id="send"><code>send</code></h2>
<p>Write data to the socket</p>
<pre><code> $wlen = $sock->send($buf, $opt_len);</code></pre>
<dl>
<dt id="obj:-sock-APR::Socket-object3">obj: <code>$sock</code> ( <code><a>APR::Socket object</a></code> )</dt>
<dd>
<p>The socket to write to</p>
</dd>
<dt id="arg1:-buf-scalar">arg1: <code>$buf</code> ( scalar )</dt>
<dd>
<p>The data to send</p>
</dd>
<dt id="opt-arg2:-opt_len-int">opt arg2: <code>$opt_len</code> ( int )</dt>
<dd>
<p>There is no need to pass this argument, unless you want to send less data than contained in <code>$buf</code>.</p>
</dd>
<dt id="ret:-wlen-integer">ret: <code>$wlen</code> ( integer )</dt>
<dd>
<p>How many bytes were sent</p>
</dd>
<dt id="since:-2.0.004">since: 2.0.00</dt>
<dd>
</dd>
</dl>
<p>For examples see the <code><a href="#C_recv_">recv</a></code> item.</p>
<h2 id="timeout_get"><code>timeout_get</code></h2>
<p>Get socket timeout settings</p>
<pre><code> $usecs = $sock->timeout_get();</code></pre>
<dl>
<dt id="obj:-sock-APR::Socket-object4">obj: <code>$sock</code> ( <code><a>APR::Socket object</a></code> )</dt>
<dd>
<p>The socket to set up.</p>
</dd>
<dt id="ret:-usecs-number">ret: <code>$usecs</code> ( number)</dt>
<dd>
<p>Currently set timeout in microseconds (and also the blocking IO behavior). See (<code><a href="#C__timeout_set_">APR::timeout_set</a></code>) for possible values and their meaning.</p>
</dd>
<dt id="excpt:-APR::Error3">excpt: <code><a>APR::Error</a></code></dt>
<dd>
</dd>
<dt id="since:-2.0.005">since: 2.0.00</dt>
<dd>
</dd>
</dl>
<h2 id="timeout_set"><code>timeout_set</code></h2>
<p>Setup socket timeout.</p>
<pre><code> $sock->timeout_set($usecs);</code></pre>
<dl>
<dt id="obj:-sock-APR::Socket-object5">obj: <code>$sock</code> ( <code><a>APR::Socket object</a></code> )</dt>
<dd>
<p>The socket to set up.</p>
</dd>
<dt id="arg1:-usecs-number">arg1: <code>$usecs</code> ( number )</dt>
<dd>
<p>Value for the timeout in microseconds and also the blocking IO behavior.</p>
<p>The possible values are:</p>
<dl>
<dt id="t-0">t > 0</dt>
<dd>
<p><code><a href="#C__send_">send()</a></code> and <code><a href="#C__recv_">recv()</a></code> throw (<code><a>APR::Const::TIMEUP</a></code> exception) if specified time elapses with no data sent or received.</p>
<p>Notice that the positive value is in micro seconds. So if you want to set the timeout for 5 seconds, the value should be: 5_000_000.</p>
<p>This mode sets the socket into a non-blocking IO mode.</p>
</dd>
<dt id="t-01">t == 0</dt>
<dd>
<p><code><a href="#C__send_">send()</a></code> and <code><a href="#C__recv_">recv()</a></code> calls never block.</p>
</dd>
<dt id="t-02">t < 0</dt>
<dd>
<p><code><a href="#C__send_">send()</a></code> and <code><a href="#C__recv_">recv()</a></code> calls block.</p>
<p>Usually just -1 is used for this case, but any negative value will do.</p>
<p>This mode sets the socket into a blocking IO mode.</p>
</dd>
<dt id="ret:-no-return-value1">ret: no return value</dt>
<dd>
</dd>
</dl>
</dd>
<dt id="excpt:-APR::Error4">excpt: <code><a>APR::Error</a></code></dt>
<dd>
</dd>
<dt id="since:-2.0.006">since: 2.0.00</dt>
<dd>
</dd>
</dl>
<h1 id="Unsupported-API">Unsupported API</h1>
<p><code>APR::Socket</code> also provides auto-generated Perl interface for a few other methods which aren't tested at the moment and therefore their API is a subject to change. These methods will be finalized later as a need arises. If you want to rely on any of the following methods please contact the <a>the mod_perl development mailing list</a> so we can help each other take the steps necessary to shift the method to an officially supported API.</p>
<h2 id="bind"><code>bind</code></h2>
<p>META: Autogenerated - needs to be reviewed/completed</p>
<p>Bind the socket to its associated port</p>
<pre><code> $ret = $sock->bind($sa);</code></pre>
<dl>
<dt id="obj:-sock-APR::Socket-object6">obj: <code>$sock</code> ( <code><a>APR::Socket object</a></code> )</dt>
<dd>
<p>The socket to bind</p>
</dd>
<dt id="arg1:-sa-APR::SockAddr-object">arg1: <code>$sa</code> ( <code><a>APR::SockAddr object</a></code> )</dt>
<dd>
<p>The socket address to bind to</p>
</dd>
<dt id="ret:-ret-integer">ret: <code>$ret</code> ( integer )</dt>
<dd>
</dd>
<dt id="since:-subject-to-change">since: subject to change</dt>
<dd>
</dd>
</dl>
<p>This may be where we will find out if there is any other process using the selected port.</p>
<h2 id="close"><code>close</code></h2>
<p>META: Autogenerated - needs to be reviewed/completed</p>
<p>Close a socket.</p>
<pre><code> $ret = $sock->close();</code></pre>
<dl>
<dt id="obj:-sock-APR::Socket-object7">obj: <code>$sock</code> ( <code><a>APR::Socket object</a></code> )</dt>
<dd>
<p>The socket to close</p>
</dd>
<dt id="ret:-ret-integer1">ret: <code>$ret</code> ( integer )</dt>
<dd>
</dd>
<dt id="since:-subject-to-change1">since: subject to change</dt>
<dd>
</dd>
</dl>
<h2 id="connect"><code>connect</code></h2>
<p>META: Autogenerated - needs to be reviewed/completed</p>
<p>Issue a connection request to a socket either on the same machine or a different one.</p>
<pre><code> $ret = $sock->connect($sa);</code></pre>
<dl>
<dt id="obj:-sock-APR::Socket-object8">obj: <code>$sock</code> ( <code><a>APR::Socket object</a></code> )</dt>
<dd>
<p>The socket we wish to use for our side of the connection</p>
</dd>
<dt id="arg1:-sa-APR::SockAddr-object1">arg1: <code>$sa</code> ( <code><a>APR::SockAddr object</a></code> )</dt>
<dd>
<p>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.</p>
</dd>
<dt id="ret:-ret-integer2">ret: <code>$ret</code> ( integer )</dt>
<dd>
</dd>
<dt id="since:-subject-to-change2">since: subject to change</dt>
<dd>
</dd>
</dl>
<h2 id="listen"><code>listen</code></h2>
<p>META: Autogenerated - needs to be reviewed/completed</p>
<p>Listen to a bound socket for connections.</p>
<pre><code> $ret = $sock->listen($backlog);</code></pre>
<dl>
<dt id="obj:-sock-APR::Socket-object9">obj: <code>$sock</code> ( <code><a>APR::Socket object</a></code> )</dt>
<dd>
<p>The socket to listen on</p>
</dd>
<dt id="arg1:-backlog-integer">arg1: <code>$backlog</code> ( integer )</dt>
<dd>
<p>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.</p>
</dd>
<dt id="ret:-ret-integer3">ret: <code>$ret</code> ( integer )</dt>
<dd>
</dd>
<dt id="since:-subject-to-change3">since: subject to change</dt>
<dd>
</dd>
</dl>
<h2 id="recvfrom"><code>recvfrom</code></h2>
<p>META: Autogenerated - needs to be reviewed/completed</p>
<pre><code> $ret = $from->recvfrom($sock, $flags, $buf, $len);</code></pre>
<dl>
<dt id="obj:-from-APR::SockAddr-object">obj: <code>$from</code> ( <code><a>APR::SockAddr object</a></code> )</dt>
<dd>
<p>The apr_sockaddr_t to fill in the recipient info</p>
</dd>
<dt id="arg1:-sock-APR::SockAddr-object">arg1: <code>$sock</code> ( <code><a>APR::SockAddr object</a></code> )</dt>
<dd>
<p>The socket to use</p>
</dd>
<dt id="arg2:-flags-integer">arg2: <code>$flags</code> ( integer )</dt>
<dd>
<p>The flags to use</p>
</dd>
<dt id="arg3:-buf-integer">arg3: <code>$buf</code> ( integer )</dt>
<dd>
<p>The buffer to use</p>
</dd>
<dt id="arg4:-len-string">arg4: <code>$len</code> ( string )</dt>
<dd>
<p>The length of the available buffer</p>
</dd>
<dt id="ret:-ret-integer4">ret: <code>$ret</code> ( integer )</dt>
<dd>
</dd>
<dt id="since:-subject-to-change4">since: subject to change</dt>
<dd>
</dd>
</dl>
<h2 id="sendto"><code>sendto</code></h2>
<p>META: Autogenerated - needs to be reviewed/completed</p>
<pre><code> $ret = $sock->sendto($where, $flags, $buf, $len);</code></pre>
<dl>
<dt id="obj:-sock-APR::Socket-object10">obj: <code>$sock</code> ( <code><a>APR::Socket object</a></code> )</dt>
<dd>
<p>The socket to send from</p>
</dd>
<dt id="arg1:-where-APR::Socket-object">arg1: <code>$where</code> ( <code><a>APR::Socket object</a></code> )</dt>
<dd>
<p>The apr_sockaddr_t describing where to send the data</p>
</dd>
<dt id="arg2:-flags-integer1">arg2: <code>$flags</code> ( integer )</dt>
<dd>
<p>The flags to use</p>
</dd>
<dt id="arg3:-buf-scalar">arg3: <code>$buf</code> ( scalar )</dt>
<dd>
<p>The data to send</p>
</dd>
<dt id="arg4:-len-string1">arg4: <code>$len</code> ( string )</dt>
<dd>
<p>The length of the data to send</p>
</dd>
<dt id="ret:-ret-integer5">ret: <code>$ret</code> ( integer )</dt>
<dd>
</dd>
<dt id="since:-subject-to-change5">since: subject to change</dt>
<dd>
</dd>
</dl>
<h1 id="See-Also">See Also</h1>
<p><a>mod_perl 2.0 documentation</a>.</p>
<h1 id="Copyright">Copyright</h1>
<p>mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0.</p>
<h1 id="Authors">Authors</h1>
<p><a>The mod_perl development team and numerous contributors</a>.</p>
</body>
</html>
|