PageRenderTime 58ms CodeModel.GetById 2ms app.highlight 44ms RepoModel.GetById 1ms app.codeStats 0ms

/configuration/org.eclipse.osgi/bundles/322/1/.cp/Resources/language/php5.4/sockets.php

https://bitbucket.org/2GAndre/myeclipse4php
PHP | 1900 lines | 182 code | 134 blank | 1584 comment | 0 complexity | 6a2073b207f7b90b66bc34e9b1534d9a MD5 | raw file

Large files files are truncated, but you can click here to view the full file

   1<?php
   2
   3// Start of sockets v.
   4
   5/**
   6 * Runs the select() system call on the given arrays of sockets with a specified timeout
   7 * @link http://www.php.net/manual/en/function.socket-select.php
   8 * @param read array <p>
   9 * The sockets listed in the read array will be
  10 * watched to see if characters become available for reading (more
  11 * precisely, to see if a read will not block - in particular, a socket
  12 * resource is also ready on end-of-file, in which case a
  13 * socket_read will return a zero length string).
  14 * </p>
  15 * @param write array <p>
  16 * The sockets listed in the write array will be
  17 * watched to see if a write will not block.
  18 * </p>
  19 * @param except array <p>
  20 * The sockets listed in the except array will be
  21 * watched for exceptions.
  22 * </p>
  23 * @param tv_sec int <p>
  24 * The tv_sec and tv_usec
  25 * together form the timeout parameter. The
  26 * timeout is an upper bound on the amount of time
  27 * elapsed before socket_select return.
  28 * tv_sec may be zero , causing
  29 * socket_select to return immediately. This is useful
  30 * for polling. If tv_sec is &null; (no timeout),
  31 * socket_select can block indefinitely.
  32 * </p>
  33 * @param tv_usec int[optional] <p>
  34 * </p>
  35 * @return int On success socket_select returns the number of
  36 * socket resources contained in the modified arrays, which may be zero if
  37 * the timeout expires before anything interesting happens. On error false
  38 * is returned. The error code can be retrieved with
  39 * socket_last_error.
  40 * </p>
  41 * <p>
  42 * Be sure to use the === operator when checking for an
  43 * error. Since the socket_select may return 0 the
  44 * comparison with == would evaluate to true:
  45 * Understanding socket_select's result
  46 * ]]>
  47 */
  48function socket_select (array &$read, array &$write, array &$except, $tv_sec, $tv_usec = null) {}
  49
  50/**
  51 * Create a socket (endpoint for communication)
  52 * @link http://www.php.net/manual/en/function.socket-create.php
  53 * @param domain int <p>
  54 * The domain parameter specifies the protocol
  55 * family to be used by the socket.
  56 * </p>
  57 * <table>
  58 * Available address/protocol families
  59 * <tr valign="top">
  60 * <td>Domain</td>
  61 * <td>Description</td>
  62 * </tr>
  63 * <tr valign="top">
  64 * <td>AF_INET</td>
  65 * <td>
  66 * IPv4 Internet based protocols. TCP and UDP are common protocols of
  67 * this protocol family.
  68 * </td>
  69 * </tr>
  70 * <tr valign="top">
  71 * <td>AF_INET6</td>
  72 * <td>
  73 * IPv6 Internet based protocols. TCP and UDP are common protocols of
  74 * this protocol family.
  75 * </td>
  76 * </tr>
  77 * <tr valign="top">
  78 * <td>AF_UNIX</td>
  79 * <td>
  80 * Local communication protocol family. High efficiency and low
  81 * overhead make it a great form of IPC (Interprocess Communication).
  82 * </td>
  83 * </tr>
  84 * </table>
  85 * @param type int <p>
  86 * The type parameter selects the type of communication
  87 * to be used by the socket.
  88 * </p>
  89 * <table>
  90 * Available socket types
  91 * <tr valign="top">
  92 * <td>Type</td>
  93 * <td>Description</td>
  94 * </tr>
  95 * <tr valign="top">
  96 * <td>SOCK_STREAM</td>
  97 * <td>
  98 * Provides sequenced, reliable, full-duplex, connection-based byte streams.
  99 * An out-of-band data transmission mechanism may be supported.
 100 * The TCP protocol is based on this socket type.
 101 * </td>
 102 * </tr>
 103 * <tr valign="top">
 104 * <td>SOCK_DGRAM</td>
 105 * <td>
 106 * Supports datagrams (connectionless, unreliable messages of a fixed maximum length).
 107 * The UDP protocol is based on this socket type.
 108 * </td>
 109 * </tr>
 110 * <tr valign="top">
 111 * <td>SOCK_SEQPACKET</td>
 112 * <td>
 113 * Provides a sequenced, reliable, two-way connection-based data transmission path for
 114 * datagrams of fixed maximum length; a consumer is required to read an
 115 * entire packet with each read call.
 116 * </td>
 117 * </tr>
 118 * <tr valign="top">
 119 * <td>SOCK_RAW</td>
 120 * <td>
 121 * Provides raw network protocol access. This special type of socket
 122 * can be used to manually construct any type of protocol. A common use
 123 * for this socket type is to perform ICMP requests (like ping).
 124 * </td>
 125 * </tr>
 126 * <tr valign="top">
 127 * <td>SOCK_RDM</td>
 128 * <td>
 129 * Provides a reliable datagram layer that does not guarantee ordering.
 130 * This is most likely not implemented on your operating system.
 131 * </td>
 132 * </tr>
 133 * </table>
 134 * @param protocol int <p>
 135 * The protocol parameter sets the specific
 136 * protocol within the specified domain to be used
 137 * when communicating on the returned socket. The proper value can be
 138 * retrieved by name by using getprotobyname. If
 139 * the desired protocol is TCP, or UDP the corresponding constants
 140 * SOL_TCP, and SOL_UDP
 141 * can also be used.
 142 * </p>
 143 * <table>
 144 * Common protocols
 145 * <tr valign="top">
 146 * <td>Name</td>
 147 * <td>Description</td>
 148 * </tr>
 149 * <tr valign="top">
 150 * <td>icmp</td>
 151 * <td>
 152 * The Internet Control Message Protocol is used primarily by gateways
 153 * and hosts to report errors in datagram communication. The "ping"
 154 * command (present in most modern operating systems) is an example
 155 * application of ICMP.
 156 * </td>
 157 * </tr>
 158 * <tr valign="top">
 159 * <td>udp</td>
 160 * <td>
 161 * The User Datagram Protocol is a connectionless, unreliable,
 162 * protocol with fixed record lengths. Due to these aspects, UDP
 163 * requires a minimum amount of protocol overhead.
 164 * </td>
 165 * </tr>
 166 * <tr valign="top">
 167 * <td>tcp</td>
 168 * <td>
 169 * The Transmission Control Protocol is a reliable, connection based,
 170 * stream oriented, full duplex protocol. TCP guarantees that all data packets
 171 * will be received in the order in which they were sent. If any packet is somehow
 172 * lost during communication, TCP will automatically retransmit the packet until
 173 * the destination host acknowledges that packet. For reliability and performance
 174 * reasons, the TCP implementation itself decides the appropriate octet boundaries
 175 * of the underlying datagram communication layer. Therefore, TCP applications must
 176 * allow for the possibility of partial record transmission.
 177 * </td>
 178 * </tr>
 179 * </table>
 180 * @return resource socket_create returns a socket resource on success,
 181 * or false on error. The actual error code can be retrieved by calling
 182 * socket_last_error. This error code may be passed to
 183 * socket_strerror to get a textual explanation of the
 184 * error.
 185 */
 186function socket_create ($domain, $type, $protocol) {}
 187
 188/**
 189 * Opens a socket on port to accept connections
 190 * @link http://www.php.net/manual/en/function.socket-create-listen.php
 191 * @param port int <p>
 192 * The port on which to listen on all interfaces.
 193 * </p>
 194 * @param backlog int[optional] <p>
 195 * The backlog parameter defines the maximum length
 196 * the queue of pending connections may grow to.
 197 * SOMAXCONN may be passed as
 198 * backlog parameter, see
 199 * socket_listen for more information.
 200 * </p>
 201 * @return resource socket_create_listen returns a new socket resource
 202 * on success or false on error. The error code can be retrieved with
 203 * socket_last_error. This code may be passed to
 204 * socket_strerror to get a textual explanation of the
 205 * error.
 206 */
 207function socket_create_listen ($port, $backlog = null) {}
 208
 209/**
 210 * Creates a pair of indistinguishable sockets and stores them in an array
 211 * @link http://www.php.net/manual/en/function.socket-create-pair.php
 212 * @param domain int <p>
 213 * The domain parameter specifies the protocol
 214 * family to be used by the socket. See socket_create
 215 * for the full list.
 216 * </p>
 217 * @param type int <p>
 218 * The type parameter selects the type of communication
 219 * to be used by the socket. See socket_create for the 
 220 * full list.
 221 * </p>
 222 * @param protocol int <p>
 223 * The protocol parameter sets the specific
 224 * protocol within the specified domain to be used
 225 * when communicating on the returned socket. The proper value can be retrieved by
 226 * name by using getprotobyname. If
 227 * the desired protocol is TCP, or UDP the corresponding constants
 228 * SOL_TCP, and SOL_UDP
 229 * can also be used.
 230 * </p>
 231 * <p>
 232 * See socket_create for the full list of supported 
 233 * protocols.
 234 * </p>
 235 * @param fd array <p>
 236 * Reference to an array in which the two socket resources will be inserted.
 237 * </p>
 238 * @return bool Returns true on success or false on failure.
 239 */
 240function socket_create_pair ($domain, $type, $protocol, array &$fd) {}
 241
 242/**
 243 * Accepts a connection on a socket
 244 * @link http://www.php.net/manual/en/function.socket-accept.php
 245 * @param socket resource <p>
 246 * A valid socket resource created with socket_create.
 247 * </p>
 248 * @return resource a new socket resource on success, or false on error. The actual
 249 * error code can be retrieved by calling
 250 * socket_last_error. This error code may be passed to
 251 * socket_strerror to get a textual explanation of the
 252 * error.
 253 */
 254function socket_accept ($socket) {}
 255
 256/**
 257 * Sets nonblocking mode for file descriptor fd
 258 * @link http://www.php.net/manual/en/function.socket-set-nonblock.php
 259 * @param socket resource <p>
 260 * A valid socket resource created with socket_create
 261 * or socket_accept.
 262 * </p>
 263 * @return bool Returns true on success or false on failure.
 264 */
 265function socket_set_nonblock ($socket) {}
 266
 267/**
 268 * Sets blocking mode on a socket resource
 269 * @link http://www.php.net/manual/en/function.socket-set-block.php
 270 * @param socket resource <p>
 271 * A valid socket resource created with socket_create
 272 * or socket_accept.
 273 * </p>
 274 * @return bool Returns true on success or false on failure.
 275 */
 276function socket_set_block ($socket) {}
 277
 278/**
 279 * Listens for a connection on a socket
 280 * @link http://www.php.net/manual/en/function.socket-listen.php
 281 * @param socket resource <p>
 282 * A valid socket resource created with socket_create.
 283 * </p>
 284 * @param backlog int[optional] <p>
 285 * A maximum of backlog incoming connections will be
 286 * queued for processing. If a connection request arrives with the queue
 287 * full the client may receive an error with an indication of
 288 * ECONNREFUSED, or, if the underlying protocol supports
 289 * retransmission, the request may be ignored so that retries may succeed.
 290 * </p>
 291 * <p>
 292 * The maximum number passed to the backlog
 293 * parameter highly depends on the underlying platform. On Linux, it is
 294 * silently truncated to SOMAXCONN. On win32, if
 295 * passed SOMAXCONN, the underlying service provider
 296 * responsible for the socket will set the backlog to a maximum
 297 * reasonable value. There is no standard provision to
 298 * find out the actual backlog value on this platform.
 299 * </p>
 300 * @return bool Returns true on success or false on failure. The error code can be retrieved with
 301 * socket_last_error. This code may be passed to
 302 * socket_strerror to get a textual explanation of the
 303 * error.
 304 */
 305function socket_listen ($socket, $backlog = null) {}
 306
 307/**
 308 * Closes a socket resource
 309 * @link http://www.php.net/manual/en/function.socket-close.php
 310 * @param socket resource <p>
 311 * A valid socket resource created with socket_create
 312 * or socket_accept.
 313 * </p>
 314 * @return void 
 315 */
 316function socket_close ($socket) {}
 317
 318/**
 319 * Write to a socket
 320 * @link http://www.php.net/manual/en/function.socket-write.php
 321 * @param socket resource <p>
 322 * </p>
 323 * @param buffer string <p>
 324 * The buffer to be written.
 325 * </p>
 326 * @param length int[optional] <p>
 327 * The optional parameter length can specify an
 328 * alternate length of bytes written to the socket. If this length is
 329 * greater then the buffer length, it is silently truncated to the length
 330 * of the buffer.
 331 * </p>
 332 * @return int the number of bytes successfully written to the socket&return.falseforfailure;.
 333 * The error code can be retrieved with
 334 * socket_last_error. This code may be passed to
 335 * socket_strerror to get a textual explanation of the
 336 * error.
 337 * </p>
 338 * <p>
 339 * It is perfectly valid for socket_write to
 340 * return zero which means no bytes have been written. Be sure to use the
 341 * === operator to check for false in case of an
 342 * error.
 343 */
 344function socket_write ($socket, $buffer, $length = null) {}
 345
 346/**
 347 * Reads a maximum of length bytes from a socket
 348 * @link http://www.php.net/manual/en/function.socket-read.php
 349 * @param socket resource <p>
 350 * A valid socket resource created with socket_create
 351 * or socket_accept.
 352 * </p>
 353 * @param length int <p>
 354 * The maximum number of bytes read is specified by the
 355 * length parameter. Otherwise you can use
 356 * &#92;r, &#92;n,
 357 * or &#92;0 to end reading (depending on the type
 358 * parameter, see below).
 359 * </p>
 360 * @param type int[optional] <p>
 361 * Optional type parameter is a named constant:
 362 * PHP_BINARY_READ (Default) - use the system
 363 * recv() function. Safe for reading binary data.
 364 * @return string socket_read returns the data as a string on success,
 365 * or false on error (including if the remote host has closed the
 366 * connection). The error code can be retrieved with
 367 * socket_last_error. This code may be passed to
 368 * socket_strerror to get a textual representation of
 369 * the error.
 370 * </p>
 371 * <p>
 372 * socket_read returns a zero length string ("")
 373 * when there is no more data to read.
 374 */
 375function socket_read ($socket, $length, $type = null) {}
 376
 377/**
 378 * Queries the local side of the given socket which may either result in host/port or in a Unix filesystem path, dependent on its type
 379 * @link http://www.php.net/manual/en/function.socket-getsockname.php
 380 * @param socket resource <p>
 381 * A valid socket resource created with socket_create 
 382 * or socket_accept.
 383 * </p>
 384 * @param addr string <p>
 385 * If the given socket is of type AF_INET
 386 * or AF_INET6, socket_getsockname
 387 * will return the local IP address in appropriate notation (e.g.
 388 * 127.0.0.1 or fe80::1) in the
 389 * address parameter and, if the optional
 390 * port parameter is present, also the associated port.
 391 * </p>
 392 * <p>
 393 * If the given socket is of type AF_UNIX,
 394 * socket_getsockname will return the Unix filesystem
 395 * path (e.g. /var/run/daemon.sock) in the
 396 * address parameter.
 397 * </p>
 398 * @param port int[optional] <p>
 399 * If provided, this will hold the associated port.
 400 * </p>
 401 * @return bool Returns true on success or false on failure. socket_getsockname may also return
 402 * false if the socket type is not any of AF_INET,
 403 * AF_INET6, or AF_UNIX, in which
 404 * case the last socket error code is not updated.
 405 */
 406function socket_getsockname ($socket, &$addr, &$port = null) {}
 407
 408/**
 409 * Queries the remote side of the given socket which may either result in host/port or in a Unix filesystem path, dependent on its type
 410 * @link http://www.php.net/manual/en/function.socket-getpeername.php
 411 * @param socket resource <p>
 412 * A valid socket resource created with socket_create
 413 * or socket_accept.
 414 * </p>
 415 * @param address string <p>
 416 * If the given socket is of type AF_INET or
 417 * AF_INET6, socket_getpeername
 418 * will return the peers (remote) IP address in
 419 * appropriate notation (e.g. 127.0.0.1 or
 420 * fe80::1) in the address
 421 * parameter and, if the optional port parameter is
 422 * present, also the associated port.
 423 * </p>
 424 * <p>
 425 * If the given socket is of type AF_UNIX,
 426 * socket_getpeername will return the Unix filesystem
 427 * path (e.g. /var/run/daemon.sock) in the
 428 * address parameter.
 429 * </p>
 430 * @param port int[optional] <p>
 431 * If given, this will hold the port associated to
 432 * address.
 433 * </p>
 434 * @return bool Returns true on success or false on failure. socket_getpeername may also return
 435 * false if the socket type is not any of AF_INET,
 436 * AF_INET6, or AF_UNIX, in which
 437 * case the last socket error code is not updated.
 438 */
 439function socket_getpeername ($socket, &$address, &$port = null) {}
 440
 441/**
 442 * Initiates a connection on a socket
 443 * @link http://www.php.net/manual/en/function.socket-connect.php
 444 * @param socket resource <p>
 445 * </p>
 446 * @param address string <p>
 447 * The address parameter is either an IPv4 address
 448 * in dotted-quad notation (e.g. 127.0.0.1) if 
 449 * socket is AF_INET, a valid 
 450 * IPv6 address (e.g. ::1) if IPv6 support is enabled and 
 451 * socket is AF_INET6
 452 * or the pathname of a Unix domain socket, if the socket family is
 453 * AF_UNIX.
 454 * </p>
 455 * @param port int[optional] <p>
 456 * The port parameter is only used and is mandatory
 457 * when connecting to an AF_INET or an 
 458 * AF_INET6 socket, and designates
 459 * the port on the remote host to which a connection should be made.
 460 * </p>
 461 * @return bool Returns true on success or false on failure. The error code can be retrieved with
 462 * socket_last_error. This code may be passed to
 463 * socket_strerror to get a textual explanation of the
 464 * error.
 465 * </p>
 466 * <p>
 467 * If the socket is non-blocking then this function returns false with an
 468 * error Operation now in progress.
 469 */
 470function socket_connect ($socket, $address, $port = null) {}
 471
 472/**
 473 * Return a string describing a socket error
 474 * @link http://www.php.net/manual/en/function.socket-strerror.php
 475 * @param errno int <p>
 476 * A valid socket error number, likely produced by 
 477 * socket_last_error.
 478 * </p>
 479 * @return string the error message associated with the errno
 480 * parameter.
 481 */
 482function socket_strerror ($errno) {}
 483
 484/**
 485 * Binds a name to a socket
 486 * @link http://www.php.net/manual/en/function.socket-bind.php
 487 * @param socket resource <p>
 488 * A valid socket resource created with socket_create.
 489 * </p>
 490 * @param address string <p>
 491 * If the socket is of the AF_INET family, the
 492 * address is an IP in dotted-quad notation
 493 * (e.g. 127.0.0.1).
 494 * </p>
 495 * <p>
 496 * If the socket is of the AF_UNIX family, the
 497 * address is the path of a
 498 * Unix-domain socket (e.g. /tmp/my.sock).
 499 * </p>
 500 * @param port int[optional] <p>
 501 * The port parameter is only used when
 502 * binding an AF_INET socket, and designates
 503 * the port on which to listen for connections.
 504 * </p>
 505 * @return bool Returns true on success or false on failure.
 506 * </p>
 507 * <p>
 508 * The error code can be retrieved with socket_last_error.
 509 * This code may be passed to socket_strerror to get a
 510 * textual explanation of the error.
 511 */
 512function socket_bind ($socket, $address, $port = null) {}
 513
 514/**
 515 * Receives data from a connected socket
 516 * @link http://www.php.net/manual/en/function.socket-recv.php
 517 * @param socket resource <p>
 518 * The socket must be a socket resource previously
 519 * created by socket_create().
 520 * </p>
 521 * @param buf string <p>
 522 * The data received will be fetched to the variable specified with
 523 * buf. If an error occurs, if the
 524 * connection is reset, or if no data is
 525 * available, buf will be set to &null;.
 526 * </p>
 527 * @param len int <p>
 528 * Up to len bytes will be fetched from remote host.
 529 * </p>
 530 * @param flags int <p>
 531 * The value of flags can be any combination of 
 532 * the following flags, joined with the binary OR (|)
 533 * operator.
 534 * </p>
 535 * <table>
 536 * Possible values for flags
 537 * <tr valign="top">
 538 * <td>Flag</td>
 539 * <td>Description</td>
 540 * </tr>
 541 * <tr valign="top">
 542 * <td>MSG_OOB</td>
 543 * <td>
 544 * Process out-of-band data.
 545 * </td>
 546 * </tr>
 547 * <tr valign="top">
 548 * <td>MSG_PEEK</td>
 549 * <td>
 550 * Receive data from the beginning of the receive queue without
 551 * removing it from the queue.
 552 * </td>
 553 * </tr>
 554 * <tr valign="top">
 555 * <td>MSG_WAITALL</td>
 556 * <td>
 557 * Block until at least len are received.
 558 * However, if a signal is caught or the remote host disconnects, the
 559 * function may return less data.
 560 * </td>
 561 * </tr>
 562 * <tr valign="top">
 563 * <td>MSG_DONTWAIT</td>
 564 * <td>
 565 * With this flag set, the function returns even if it would normally
 566 * have blocked.
 567 * </td>
 568 * </tr>
 569 * </table>
 570 * @return int socket_recv returns the number of bytes received,
 571 * or false if there was an error. The actual error code can be retrieved by 
 572 * calling socket_last_error. This error code may be
 573 * passed to socket_strerror to get a textual explanation
 574 * of the error.
 575 */
 576function socket_recv ($socket, &$buf, $len, $flags) {}
 577
 578/**
 579 * Sends data to a connected socket
 580 * @link http://www.php.net/manual/en/function.socket-send.php
 581 * @param socket resource <p>
 582 * A valid socket resource created with socket_create
 583 * or socket_accept.
 584 * </p>
 585 * @param buf string <p>
 586 * A buffer containing the data that will be sent to the remote host.
 587 * </p>
 588 * @param len int <p>
 589 * The number of bytes that will be sent to the remote host from 
 590 * buf.
 591 * </p>
 592 * @param flags int <p>
 593 * The value of flags can be any combination of 
 594 * the following flags, joined with the binary OR (|)
 595 * operator.
 596 * <table>
 597 * Possible values for flags
 598 * <tr valign="top">
 599 * <td>MSG_OOB</td>
 600 * <td>
 601 * Send OOB (out-of-band) data.
 602 * </td>
 603 * </tr>
 604 * <tr valign="top">
 605 * <td>MSG_EOR</td>
 606 * <td>
 607 * Indicate a record mark. The sent data completes the record.
 608 * </td>
 609 * </tr>
 610 * <tr valign="top">
 611 * <td>MSG_EOF</td>
 612 * <td>
 613 * Close the sender side of the socket and include an appropriate
 614 * notification of this at the end of the sent data. The sent data
 615 * completes the transaction.
 616 * </td>
 617 * </tr>
 618 * <tr valign="top">
 619 * <td>MSG_DONTROUTE</td>
 620 * <td>
 621 * Bypass routing, use direct interface.
 622 * </td>
 623 * </tr>
 624 * </table>
 625 * </p>
 626 * @return int socket_send returns the number of bytes sent, or false on error.
 627 */
 628function socket_send ($socket, $buf, $len, $flags) {}
 629
 630/**
 631 * Receives data from a socket whether or not it is connection-oriented
 632 * @link http://www.php.net/manual/en/function.socket-recvfrom.php
 633 * @param socket resource <p>
 634 * The socket must be a socket resource previously
 635 * created by socket_create().
 636 * </p>
 637 * @param buf string <p>
 638 * The data received will be fetched to the variable specified with
 639 * buf.
 640 * </p>
 641 * @param len int <p>
 642 * Up to len bytes will be fetched from remote host.
 643 * </p>
 644 * @param flags int <p>
 645 * The value of flags can be any combination of 
 646 * the following flags, joined with the binary OR (|)
 647 * operator.
 648 * </p>
 649 * <table>
 650 * Possible values for flags
 651 * <tr valign="top">
 652 * <td>Flag</td>
 653 * <td>Description</td>
 654 * </tr>
 655 * <tr valign="top">
 656 * <td>MSG_OOB</td>
 657 * <td>
 658 * Process out-of-band data.
 659 * </td>
 660 * </tr>
 661 * <tr valign="top">
 662 * <td>MSG_PEEK</td>
 663 * <td>
 664 * Receive data from the beginning of the receive queue without
 665 * removing it from the queue.
 666 * </td>
 667 * </tr>
 668 * <tr valign="top">
 669 * <td>MSG_WAITALL</td>
 670 * <td>
 671 * Block until at least len are received.
 672 * However, if a signal is caught or the remote host disconnects, the
 673 * function may return less data.
 674 * </td>
 675 * </tr>
 676 * <tr valign="top">
 677 * <td>MSG_DONTWAIT</td>
 678 * <td>
 679 * With this flag set, the function returns even if it would normally
 680 * have blocked.
 681 * </td>
 682 * </tr>
 683 * </table>
 684 * @param name string <p>
 685 * If the socket is of the type AF_UNIX type,
 686 * name is the path to the file. Else, for
 687 * unconnected sockets, name is the IP address of,
 688 * the remote host, or &null; if the socket is connection-oriented.
 689 * </p>
 690 * @param port int[optional] <p>
 691 * This argument only applies to AF_INET and
 692 * AF_INET6 sockets, and specifies the remote port
 693 * from which the data is received. If the socket is connection-oriented,
 694 * port will be &null;.
 695 * </p>
 696 * @return int socket_recvfrom returns the number of bytes received,
 697 * or false if there was an error. The actual error code can be retrieved by 
 698 * calling socket_last_error. This error code may be
 699 * passed to socket_strerror to get a textual explanation
 700 * of the error.
 701 */
 702function socket_recvfrom ($socket, &$buf, $len, $flags, &$name, &$port = null) {}
 703
 704/**
 705 * Sends a message to a socket, whether it is connected or not
 706 * @link http://www.php.net/manual/en/function.socket-sendto.php
 707 * @param socket resource <p>
 708 * A valid socket resource created using socket_create.
 709 * </p>
 710 * @param buf string <p>
 711 * The sent data will be taken from buffer buf.
 712 * </p>
 713 * @param len int <p>
 714 * len bytes from buf will be
 715 * sent.
 716 * </p>
 717 * @param flags int <p>
 718 * The value of flags can be any combination of 
 719 * the following flags, joined with the binary OR (|)
 720 * operator.
 721 * <table>
 722 * Possible values for flags
 723 * <tr valign="top">
 724 * <td>MSG_OOB</td>
 725 * <td>
 726 * Send OOB (out-of-band) data.
 727 * </td>
 728 * </tr>
 729 * <tr valign="top">
 730 * <td>MSG_EOR</td>
 731 * <td>
 732 * Indicate a record mark. The sent data completes the record.
 733 * </td>
 734 * </tr>
 735 * <tr valign="top">
 736 * <td>MSG_EOF</td>
 737 * <td>
 738 * Close the sender side of the socket and include an appropriate
 739 * notification of this at the end of the sent data. The sent data
 740 * completes the transaction.
 741 * </td>
 742 * </tr>
 743 * <tr valign="top">
 744 * <td>MSG_DONTROUTE</td>
 745 * <td>
 746 * Bypass routing, use direct interface.
 747 * </td>
 748 * </tr>
 749 * </table>
 750 * </p>
 751 * @param addr string <p>
 752 * IP address of the remote host.
 753 * </p>
 754 * @param port int[optional] <p>
 755 * port is the remote port number at which the data
 756 * will be sent.
 757 * </p>
 758 * @return int socket_sendto returns the number of bytes sent to the
 759 * remote host, or false if an error occurred.
 760 */
 761function socket_sendto ($socket, $buf, $len, $flags, $addr, $port = null) {}
 762
 763/**
 764 * Gets socket options for the socket
 765 * @link http://www.php.net/manual/en/function.socket-get-option.php
 766 * @param socket resource <p>
 767 * A valid socket resource created with socket_create
 768 * or socket_accept.
 769 * </p>
 770 * @param level int <p>
 771 * The level parameter specifies the protocol
 772 * level at which the option resides. For example, to retrieve options at
 773 * the socket level, a level parameter of
 774 * SOL_SOCKET would be used. Other levels, such as
 775 * TCP, can be used by
 776 * specifying the protocol number of that level. Protocol numbers can be
 777 * found by using the getprotobyname function.
 778 * </p>
 779 * @param optname int <table>
 780 * Available Socket Options
 781 * <tr valign="top">
 782 * <td>Option</td>
 783 * <td>Description</td>
 784 * <td>Type</td>
 785 * </tr>
 786 * <tr valign="top">
 787 * <td>SO_DEBUG</td>
 788 * <td>
 789 * Reports whether debugging information is being recorded.
 790 * </td>
 791 * <td>
 792 * int
 793 * </td>
 794 * </tr>
 795 * <tr valign="top">
 796 * <td>SO_BROADCAST</td>
 797 * <td>
 798 * Reports whether transmission of broadcast messages is supported.
 799 * </td>
 800 * <td>
 801 * int
 802 * </td>
 803 * </tr>
 804 * <tr valign="top">
 805 * <td>SO_REUSEADDR</td>
 806 * <td>
 807 * Reports whether local addresses can be reused.
 808 * </td>
 809 * <td>
 810 * int
 811 * </td>
 812 * </tr>
 813 * <tr valign="top">
 814 * <td>SO_KEEPALIVE</td>
 815 * <td>
 816 * Reports whether connections are kept active with periodic transmission
 817 * of messages. If the connected socket fails to respond to these messages,
 818 * the connection is broken and processes writing to that socket are notified
 819 * with a SIGPIPE signal.
 820 * </td>
 821 * <td>
 822 * int
 823 * </td>
 824 * </tr>
 825 * <tr valign="top">
 826 * <td>SO_LINGER</td>
 827 * <td>
 828 * <p>
 829 * Reports whether the socket lingers on 
 830 * socket_close if data is present. By default, 
 831 * when the socket is closed, it attempts to send all unsent data.
 832 * In the case of a connection-oriented socket, 
 833 * socket_close will wait for its peer to
 834 * acknowledge the data. 
 835 * </p>
 836 * <p>
 837 * If l_onoff is non-zero and 
 838 * l_linger is zero, all the 
 839 * unsent data will be discarded and RST (reset) is sent to the 
 840 * peer in the case of a connection-oriented socket. 
 841 * </p>
 842 * <p>
 843 * On the other hand, if l_onoff is 
 844 * non-zero and l_linger is non-zero,
 845 * socket_close will block until all the data 
 846 * is sent or the time specified in l_linger
 847 * elapses. If the socket is non-blocking, 
 848 * socket_close will fail and return an error.
 849 * </p>
 850 * </td>
 851 * <td>
 852 * array. The array will contain two keys:
 853 * l_onoff and 
 854 * l_linger. 
 855 * </td>
 856 * </tr>
 857 * <tr valign="top">
 858 * <td>SO_OOBINLINE</td>
 859 * <td>
 860 * Reports whether the socket leaves out-of-band data inline.
 861 * </td>
 862 * <td>
 863 * int
 864 * </td>
 865 * </tr>
 866 * <tr valign="top">
 867 * <td>SO_SNDBUF</td>
 868 * <td>
 869 * Reports the size of the send buffer.
 870 * </td>
 871 * <td>
 872 * int
 873 * </td> 
 874 * </tr>
 875 * <tr valign="top">
 876 * <td>SO_RCVBUF</td>
 877 * <td>
 878 * Reports the size of the receive buffer.
 879 * </td>
 880 * <td>
 881 * int
 882 * </td> 
 883 * </tr>
 884 * <tr valign="top">
 885 * <td>SO_ERROR</td>
 886 * <td>
 887 * Reports information about error status and clears it.
 888 * </td>
 889 * <td>
 890 * int (cannot be set by socket_set_option)
 891 * </td>
 892 * </tr>
 893 * <tr valign="top">
 894 * <td>SO_TYPE</td>
 895 * <td>
 896 * Reports the socket type (e.g. 
 897 * SOCK_STREAM).
 898 * </td>
 899 * <td>
 900 * int (cannot be set by socket_set_option)
 901 * </td>
 902 * </tr>
 903 * <tr valign="top">
 904 * <td>SO_DONTROUTE</td>
 905 * <td>
 906 * Reports whether outgoing messages bypass the standard routing facilities.
 907 * </td>
 908 * <td>
 909 * int
 910 * </td>
 911 * </tr>
 912 * <tr valign="top">
 913 * <td>SO_RCVLOWAT</td>
 914 * <td>
 915 * Reports the minimum number of bytes to process for socket 
 916 * input operations.
 917 * </td>
 918 * <td>
 919 * int
 920 * </td>
 921 * </tr>
 922 * <tr valign="top">
 923 * <td>SO_RCVTIMEO</td>
 924 * <td>
 925 * Reports the timeout value for input operations.
 926 * </td>
 927 * <td>
 928 * array. The array will contain two keys:
 929 * sec which is the seconds part on the timeout
 930 * value and usec which is the microsecond part 
 931 * of the timeout value. 
 932 * </td>
 933 * </tr>
 934 * <tr valign="top">
 935 * <td>SO_SNDTIMEO</td>
 936 * <td>
 937 * Reports the timeout value specifying the amount of time that an output
 938 * function blocks because flow control prevents data from being sent.
 939 * </td>
 940 * <td>
 941 * array. The array will contain two keys:
 942 * sec which is the seconds part on the timeout
 943 * value and usec which is the microsecond part 
 944 * of the timeout value. 
 945 * </td>
 946 * </tr>
 947 * <tr valign="top">
 948 * <td>SO_SNDLOWAT</td>
 949 * <td>
 950 * Reports the minimum number of bytes to process for socket output operations.
 951 * </td>
 952 * <td>
 953 * int
 954 * </td>
 955 * </tr>
 956 * <tr valign="top">
 957 * <td>TCP_NODELAY</td>
 958 * <td>
 959 * Reports whether the Nagle TCP algorithm is disabled.
 960 * </td>
 961 * <td>
 962 * int
 963 * </td>
 964 * </tr>
 965 * <tr valign="top">
 966 * <td>MCAST_JOIN_GROUP</td>
 967 * <td>
 968 * Joins a multicast group. (added in PHP 5.4)
 969 * </td>
 970 * <td>
 971 * array with keys "group", specifying
 972 * a string with an IPv4 or IPv6 multicast address and
 973 * "interface", specifying either an interface
 974 * number (type int) or a string with
 975 * the interface name, like "eth0".
 976 * 0 can be specified to indicate the interface
 977 * should be selected using routing rules. (can only be used in
 978 * socket_set_option)
 979 * </td>
 980 * </tr>
 981 * <tr valign="top">
 982 * <td>MCAST_LEAVE_GROUP</td>
 983 * <td>
 984 * Leaves a multicast group. (added in PHP 5.4)
 985 * </td>
 986 * <td>
 987 * array. See MCAST_JOIN_GROUP for
 988 * more information. (can only be used in
 989 * socket_set_option)
 990 * </td>
 991 * </tr>
 992 * <tr valign="top">
 993 * <td>MCAST_BLOCK_SOURCE</td>
 994 * <td>
 995 * Blocks packets arriving from a specific source to a specific
 996 * multicast group, which must have been previously joined.
 997 * (added in PHP 5.4)
 998 * </td>
 999 * <td>
1000 * array with the same keys as
1001 * MCAST_JOIN_GROUP, plus one extra key,
1002 * source, which maps to a string
1003 * specifying an IPv4 or IPv6 address of the source to be blocked.
1004 * (can only be used in socket_set_option)
1005 * </td>
1006 * </tr>
1007 * <tr valign="top">
1008 * <td>MCAST_UNBLOCK_SOURCE</td>
1009 * <td>
1010 * Unblocks (start receiving again) packets arriving from a specific
1011 * source address to a specific multicast group, which must have been
1012 * previously joined. (added in PHP 5.4)
1013 * </td>
1014 * <td>
1015 * array with the same format as
1016 * MCAST_BLOCK_SOURCE.
1017 * (can only be used in socket_set_option)
1018 * </td>
1019 * </tr>
1020 * <tr valign="top">
1021 * <td>MCAST_JOIN_SOURCE_GROUP</td>
1022 * <td>
1023 * Receive packets destined to a specific multicast group whose source
1024 * address matches a specific value. (added in PHP 5.4)
1025 * </td>
1026 * <td>
1027 * array with the same format as
1028 * MCAST_BLOCK_SOURCE.
1029 * (can only be used in socket_set_option)
1030 * </td>
1031 * </tr>
1032 * <tr valign="top">
1033 * <td>MCAST_LEAVE_SOURCE_GROUP</td>
1034 * <td>
1035 * Stop receiving packets destined to a specific multicast group whose
1036 * soure address matches a specific value. (added in PHP 5.4)
1037 * </td>
1038 * <td>
1039 * array with the same format as
1040 * MCAST_BLOCK_SOURCE.
1041 * (can only be used in socket_set_option)
1042 * </td>
1043 * </tr>
1044 * <tr valign="top">
1045 * <td>IP_MULTICAST_IF</td>
1046 * <td>
1047 * The outgoing interface for IPv4 multicast packets.
1048 * (added in PHP 5.4)
1049 * </td>
1050 * <td>
1051 * Either int specifying the interface number or a
1052 * string with an interface name, like
1053 * eth0. The value 0 can be used to
1054 * indicate the routing table is to used in the interface selection.
1055 * The function socket_get_option returns an
1056 * interface index.
1057 * Note that, unlike the C API, this option does NOT take an IP
1058 * address. This eliminates the interface difference between
1059 * IP_MULTICAST_IF and
1060 * IPV6_MULTICAST_IF.
1061 * </td>
1062 * </tr>
1063 * <tr valign="top">
1064 * <td>IPV6_MULTICAST_IF</td>
1065 * <td>
1066 * The outgoing interface for IPv6 multicast packets.
1067 * (added in PHP 5.4)
1068 * </td>
1069 * <td>
1070 * The same as IP_MULTICAST_IF.
1071 * </td>
1072 * </tr>
1073 * <tr valign="top">
1074 * <td>IP_MULTICAST_LOOP</td>
1075 * <td>
1076 * The multicast loopback policy for IPv4 packets, which
1077 * determines whether multicast packets sent by this socket also reach
1078 * receivers in the same host that have joined the same multicast group
1079 * on the outgoing interface used by this socket. This is the case by
1080 * default.
1081 * (added in PHP 5.4)
1082 * </td>
1083 * <td>
1084 * int (either 0 or
1085 * 1). For socket_set_option
1086 * any value will be accepted and will be converted to a boolean
1087 * following the usual PHP rules.
1088 * </td>
1089 * </tr>
1090 * <tr valign="top">
1091 * <td>IPV6_MULTICAST_LOOP</td>
1092 * <td>
1093 * Analogous to IP_MULTICAST_LOOP, but for IPv6.
1094 * (added in PHP 5.4)
1095 * </td>
1096 * <td>
1097 * int. See IP_MULTICAST_LOOP.
1098 * </td>
1099 * </tr>
1100 * <tr valign="top">
1101 * <td>IP_MULTICAST_TTL</td>
1102 * <td>
1103 * The time-to-live of outgoing IPv4 multicast packets. This should be
1104 * a value between 0 (don't leave the interface) and 255. The default
1105 * value is 1 (only the local network is reached).
1106 * (added in PHP 5.4)
1107 * </td>
1108 * <td>
1109 * int between 0 and 255.
1110 * </td>
1111 * </tr>
1112 * <tr valign="top">
1113 * <td>IPV6_MULTICAST_HOPS</td>
1114 * <td>
1115 * Analogous to IP_MULTICAST_TTL, but for IPv6
1116 * packets. The value -1 is also accepted, meaning the route default
1117 * should be used.
1118 * (added in PHP 5.4)
1119 * </td>
1120 * <td>
1121 * int between -1 and 255.
1122 * </td>
1123 * </tr>
1124 * </table>
1125 * @return mixed the value of the given option, or false on errors.
1126 */
1127function socket_get_option ($socket, $level, $optname) {}
1128
1129/**
1130 * Sets socket options for the socket
1131 * @link http://www.php.net/manual/en/function.socket-set-option.php
1132 * @param socket resource <p>
1133 * A valid socket resource created with socket_create
1134 * or socket_accept.
1135 * </p>
1136 * @param level int <p>
1137 * The level parameter specifies the protocol
1138 * level at which the option resides. For example, to retrieve options at
1139 * the socket level, a level parameter of
1140 * SOL_SOCKET would be used. Other levels, such as
1141 * TCP, can be used by specifying the protocol number of that level. 
1142 * Protocol numbers can be found by using the 
1143 * getprotobyname function.
1144 * </p>
1145 * @param optname int <p>
1146 * The available socket options are the same as those for the
1147 * socket_get_option function.
1148 * </p>
1149 * @param optval mixed <p>
1150 * The option value.
1151 * </p>
1152 * @return bool Returns true on success or false on failure.
1153 */
1154function socket_set_option ($socket, $level, $optname, $optval) {}
1155
1156/**
1157 * Shuts down a socket for receiving, sending, or both
1158 * @link http://www.php.net/manual/en/function.socket-shutdown.php
1159 * @param socket resource <p>
1160 * A valid socket resource created with socket_create.
1161 * </p>
1162 * @param how int[optional] <p>
1163 * The value of how can be one of the following:
1164 * <table>
1165 * possible values for how
1166 * <tr valign="top">
1167 * <td>0</td>
1168 * <td>
1169 * Shutdown socket reading
1170 * </td>
1171 * </tr>
1172 * <tr valign="top">
1173 * <td>1</td>
1174 * <td>
1175 * Shutdown socket writing
1176 * </td>
1177 * </tr>
1178 * <tr valign="top">
1179 * <td>2</td>
1180 * <td>
1181 * Shutdown socket reading and writing
1182 * </td>
1183 * </tr>
1184 * </table>
1185 * </p>
1186 * @return bool Returns true on success or false on failure.
1187 */
1188function socket_shutdown ($socket, $how = null) {}
1189
1190/**
1191 * Returns the last error on the socket
1192 * @link http://www.php.net/manual/en/function.socket-last-error.php
1193 * @param socket resource[optional] <p>
1194 * A valid socket resource created with socket_create.
1195 * </p>
1196 * @return int This function returns a socket error code.
1197 */
1198function socket_last_error ($socket = null) {}
1199
1200/**
1201 * Clears the error on the socket or the last error code
1202 * @link http://www.php.net/manual/en/function.socket-clear-error.php
1203 * @param socket resource[optional] <p>
1204 * A valid socket resource created with socket_create.
1205 * </p>
1206 * @return void 
1207 */
1208function socket_clear_error ($socket = null) {}
1209
1210/**
1211 * @param stream
1212 */
1213function socket_import_stream ($stream) {}
1214
1215/**
1216 * @param socket
1217 * @param level
1218 * @param optname
1219 */
1220function socket_getopt ($socket, $level, $optname) {}
1221
1222/**
1223 * @param socket
1224 * @param level
1225 * @param optname
1226 * @param optval
1227 */
1228function socket_setopt ($socket, $level, $optname, $optval) {}
1229
1230define ('AF_UNIX', 1);
1231define ('AF_INET', 2);
1232
1233/**
1234 * Only available if compiled with IPv6 support.
1235 * @link http://www.php.net/manual/en/sockets.constants.php
1236 */
1237define ('AF_INET6', 10);
1238define ('SOCK_STREAM', 1);
1239define ('SOCK_DGRAM', 2);
1240define ('SOCK_RAW', 3);
1241define ('SOCK_SEQPACKET', 5);
1242define ('SOCK_RDM', 4);
1243define ('MSG_OOB', 1);
1244define ('MSG_WAITALL', 256);
1245define ('MSG_DONTWAIT', 64);
1246define ('MSG_PEEK', 2);
1247define ('MSG_DONTROUTE', 4);
1248
1249/**
1250 * Not available on Windows platforms.
1251 * @link http://www.php.net/manual/en/sockets.constants.php
1252 */
1253define ('MSG_EOR', 128);
1254
1255/**
1256 * Not available on Windows platforms.
1257 * @link http://www.php.net/manual/en/sockets.constants.php
1258 */
1259define ('MSG_EOF', 512);
1260define ('SO_DEBUG', 1);
1261define ('SO_REUSEADDR', 2);
1262define ('SO_KEEPALIVE', 9);
1263define ('SO_DONTROUTE', 5);
1264define ('SO_LINGER', 13);
1265define ('SO_BROADCAST', 6);
1266define ('SO_OOBINLINE', 10);
1267define ('SO_SNDBUF', 7);
1268define ('SO_RCVBUF', 8);
1269define ('SO_SNDLOWAT', 19);
1270define ('SO_RCVLOWAT', 18);
1271define ('SO_SNDTIMEO', 21);
1272define ('SO_RCVTIMEO', 20);
1273define ('SO_TYPE', 3);
1274define ('SO_ERROR', 4);
1275define ('SOL_SOCKET', 1);
1276define ('SOMAXCONN', 128);
1277
1278/**
1279 * Used to disable Nagle TCP algorithm.
1280 * Added in PHP 5.2.7.
1281 * @link http://www.php.net/manual/en/sockets.constants.php
1282 */
1283define ('TCP_NODELAY', 1);
1284define ('PHP_NORMAL_READ', 1);
1285define ('PHP_BINARY_READ', 2);
1286define ('MCAST_JOIN_GROUP', 42);
1287define ('MCAST_LEAVE_GROUP', 45);
1288define ('MCAST_BLOCK_SOURCE', 43);
1289define ('MCAST_UNBLOCK_SOURCE', 44);
1290define ('MCAST_JOIN_SOURCE_GROUP', 46);
1291define ('MCAST_LEAVE_SOURCE_GROUP', 47);
1292define ('IP_MULTICAST_IF', 32);
1293define ('IP_MULTICAST_TTL', 33);
1294define ('IP_MULTICAST_LOOP', 34);
1295define ('IPV6_MULTICAST_IF', 17);
1296define ('IPV6_MULTICAST_HOPS', 18);
1297define ('IPV6_MULTICAST_LOOP', 19);
1298
1299/**
1300 * Operation not permitted.
1301 * @link http://www.php.net/manual/en/sockets.constants.php
1302 */
1303define ('SOCKET_EPERM', 1);
1304
1305/**
1306 * No such file or directory.
1307 * @link http://www.php.net/manual/en/sockets.constants.php
1308 */
1309define ('SOCKET_ENOENT', 2);
1310
1311/**
1312 * Interrupted system call.
1313 * @link http://www.php.net/manual/en/sockets.constants.php
1314 */
1315define ('SOCKET_EINTR', 4);
1316
1317/**
1318 * I/O error.
1319 * @link http://www.php.net/manual/en/sockets.constants.php
1320 */
1321define ('SOCKET_EIO', 5);
1322
1323/**
1324 * No such device or address.
1325 * @link http://www.php.net/manual/en/sockets.constants.php
1326 */
1327define ('SOCKET_ENXIO', 6);
1328
1329/**
1330 * Arg list too long.
1331 * @link http://www.php.net/manual/en/sockets.constants.php
1332 */
1333define ('SOCKET_E2BIG', 7);
1334
1335/**
1336 * Bad file number.
1337 * @link http://www.php.net/manual/en/sockets.constants.php
1338 */
1339define ('SOCKET_EBADF', 9);
1340
1341/**
1342 * Try again.
1343 * @link http://www.php.net/manual/en/sockets.constants.php
1344 */
1345define ('SOCKET_EAGAIN', 11);
1346
1347/**
1348 * Out of memory.
1349 * @link http://www.php.net/manual/en/sockets.constants.php
1350 */
1351define ('SOCKET_ENOMEM', 12);
1352
1353/**
1354 * Permission denied.
1355 * @link http://www.php.net/manual/en/sockets.constants.php
1356 */
1357define ('SOCKET_EACCES', 13);
1358
1359/**
1360 * Bad address.
1361 * @link http://www.php.net/manual/en/sockets.constants.php
1362 */
1363define ('SOCKET_EFAULT', 14);
1364
1365/**
1366 * Block device required.
1367 * @link http://www.php.net/manual/en/sockets.constants.php
1368 */
1369define ('SOCKET_ENOTBLK', 15);
1370
1371/**
1372 * Device or resource busy.
1373 * @link http://www.php.net/manual/en/sockets.constants.php
1374 */
1375define ('SOCKET_EBUSY', 16);
1376
1377/**
1378 * File exists.
1379 * @link http://www.php.net/manual/en/sockets.constants.php
1380 */
1381define ('SOCKET_EEXIST', 17);
1382
1383/**
1384 * Cross-device link.
1385 * @link http://www.php.net/manual/en/sockets.constants.php
1386 */
1387define ('SOCKET_EXDEV', 18);
1388
1389/**
1390 * No such device.
1391 * @link http://www.php.net/manual/en/sockets.constants.php
1392 */
1393define ('SOCKET_ENODEV', 19);
1394
1395/**
1396 * Not a directory.
1397 * @link http://www.php.net/manual/en/sockets.constants.php
1398 */
1399define ('SOCKET_ENOTDIR', 20);
1400
1401/**
1402 * Is a directory.
1403 * @link http://www.php.net/manual/en/sockets.constants.php
1404 */
1405define ('SOCKET_EISDIR', 21);
1406
1407/**
1408 * Invalid argument.
1409 * @link http://www.php.net/manual/en/sockets.constants.php
1410 */
1411define ('SOCKET_EINVAL', 22);
1412
1413/**
1414 * File table overflow.
1415 * @link http://www.php.net/manual/en/sockets.constants.php
1416 */
1417define ('SOCKET_ENFILE', 23);
1418
1419/**
1420 * Too many open files.
1421 * @link http://www.php.net/manual/en/sockets.constants.php
1422 */
1423define ('SOCKET_EMFILE', 24);
1424
1425/**
1426 * Not a typewriter.
1427 * @link http://www.php.net/manual/en/sockets.constants.php
1428 */
1429define ('SOCKET_ENOTTY', 25);
1430
1431/**
1432 * No space left on device.
1433 * @link http://www.php.net/manual/en/sockets.constants.php
1434 */
1435define ('SOCKET_ENOSPC', 28);
1436
1437/**
1438 * Illegal seek.
1439 * @link http://www.php.net/manual/en/sockets.constants.php
1440 */
1441define ('SOCKET_ESPIPE', 29);
1442
1443/**
1444 * Read-only file system.
1445 * @link http://www.php.net/manual/en/sockets.constants.php
1446 */
1447define ('SOCKET_EROFS', 30);
1448
1449/**
1450 * Too many links.
1451 * @link http://www.php.net/manual/en/sockets.constants.php
1452 */
1453define ('SOCKET_EMLINK', 31);
1454
1455/**
1456 * Broken pipe.
1457 * @link http://www.php.net/manual/en/sockets.constants.php
1458 */
1459define ('SOCKET_EPIPE', 32);
1460
1461/**
1462 * File name too long.
1463 * @link http://www.php.net/manual/en/sockets.constants.php
1464 */
1465define ('SOCKET_ENAMETOOLONG', 36);
1466
1467/**
1468 * No record locks available.
1469 * @link http://www.php.net/manual/en/sockets.constants.php
1470 */
1471define ('SOCKET_ENOLCK', 37);
1472
1473/**
1474 * Function not implemented.
1475 * @link http://www.php.net/manual/en/sockets.constants.php
1476 */
1477define ('SOCKET_ENOSYS', 38);
1478
1479/**
1480 * Directory not empty.
1481 * @link http://www.php.net/manual/en/sockets.constants.php
1482 */
1483define ('SOCKET_ENOTEMPTY', 39);
1484
1485/**
1486 * Too many symbolic links encountered.
1487 * @link http://www.php.net/manual/en/sockets.constants.php
1488 */
1489define ('SOCKET_ELOOP', 40);
1490
1491/**
1492 * Operation would block.
1493 * @link http://www.php.net/manual/en/sockets.constants.php
1494 */
1495define ('SOCKET_EWOULDBLOCK', 11);
1496
1497/**
1498 * No message of desired type.
1499 * @link http://www.php.net/manual/en/sockets.constants.php
1500 */
1501define ('SOCKET_ENOMSG', 42);
1502
1503/**
1504 * Identifier removed.
1505 * @link http://www.php.net/manual/en/sockets.constants.php
1506 */
1507define ('SOCKET_EIDRM', 43);
1508
1509/**
1510 * Channel number out of range.
1511 * @link http://www.php.net/manual/en/sockets.constants.php
1512 */
1513define ('SOCKET_ECHRNG', 44);
1514
1515/**
1516 * Level 2 not synchronized.
1517 * @link http://www.php.net/manual/en/sockets.constants.php
1518 */
1519define ('SOCKET_EL2NSYNC', 45);
1520
1521/**
1522 * Level 3 halted.
1523 * @link http://www.php.net/manual/en/sockets.constants.php
1524 */
1525define ('SOCKET_EL3HLT', 46);
1526
1527/**
1528 * Level 3 reset.
1529 * @link http://www.php.net/manual/en/sockets.constants.php
1530 */
1531define ('SOCKET_EL3RST', 47);
1532
1533/**
1534 * Link number out of range.
1535 * @link http://www.php.net/manual/en/sockets.constants.php
1536 */
1537define ('SOCKET_ELNRNG', 48);
1538
1539/**
1540 * Protocol driver not attached.
1541 * @link http://www.php.net/manual/en/sockets.constants.php
1542 */
1543define ('SOCKET_EUNATCH', 49);
1544
1545/**
1546 * No CSI structure available.
1547 * @link http://www.php.net/manual/en/sockets.constants.php
1548 */
1549define ('SOCKET_ENOCSI', 50);
1550
1551/**
1552 * Level 2 halted.
1553 * @link http://www.php.net/manual/en/sockets.constants.php
1554 */
1555define ('SOCKET_EL2HLT', 51);
1556
1557/**
1558 * Invalid exchange.
1559 * @link http://www.php.net/manual/en/sockets.constants.php
1560 */
1561define ('SOCKET_EBADE', 52);
1562
1563/**
1564 * Invalid request descriptor.
1565 * @link http://www.php.net/manual/en/sockets.constants.php
1566 */
1567define ('SOCKET_EBADR', 53);
1568
1569/**
1570 * Exchange full.
1571 * @link http://www.php.net/manual/en/sockets.constants.php
1572 */
1573define ('SOCKET_EXFULL', 54);
1574
1575/**
1576 * No anode.
1577 * @link http://www.php.net/manual/en/sockets.constants.php
1578 */
1579define ('SOCKET_ENOANO', 55);
1580
1581/**
1582 * Invalid request code.
1583 * @link http://www.php.net/manual/en/sockets.constants.php
1584 */
1585define ('SOCKET_EBADRQC', 56);
1586
1587/**
1588 * Invalid slot.
1589 * @link http://www.php.net/manual/en/sockets.constants.php
1590 */
1591define ('SOCKET_EBADSLT', 57);
1592
1593/**
1594 * Device not a stream.
1595 * @link http://www.php.net/manual/en/sockets.constants.php
1596 */
1597define ('SOCKET_ENOSTR', 60);
1598
1599/**
1600 * No data available.
1601 * @link http://www.php.net/manual/en/sockets.constants.php
1602 */
1603define ('SOCKET_ENODATA', 61);
1604
1605/**
1606 * Timer expired.
1607 * @link http://www.php.net/manual/en/sockets.constants.php
1608 */
1609define ('SOCKET_ETIME', 62);
1610
1611/**
1612 * Out of streams resources.
1613 * @link http://www.php.net/manual/en/sockets.constants.php
1614 */
1615define ('SOCKET_ENOSR', 63);
1616
1617/**
1618 * Machine is not on the network.
1619 * @link http://www.php.net/manual/en/sockets.constants.php
1620 */
1621define ('SOCKET_ENONET', 64);
1622
1623/**
1624 * Object is remote.
1625 * @link http://www.php.net/manual/en/sockets.constants.php
1626 */
1627define ('SOCKET_EREMOTE', 66);
1628
1629/**
1630 * Link has been severed.
1631 * @link http://www.php.net/manual/en/sockets.constants.php
1632 */
1633define ('SOCKET_ENOLINK', 67);
1634
1635/**
1636 * Advertise error.
1637 * @link http://www.php.net/manual/en/sockets.constants.php
1638 */
1639define ('SOCKET_EADV', 68);
1640
1641/**
1642 * Srmount error.
1643 * @link http://www.php.net/manual/en/sockets.constants.php
1644 */
1645define ('SOCKET_ESRMNT', 69);
1646
1647/**
1648 * Communication error on send.
1649 * @link http://www.php.net/manual/en/sockets.constants.php
1650 */
1651define ('SOCKET_ECOMM', 70);
1652
1653/**
1654 * Protocol error.
1655 * @link http://www.php.net/manual/en/sockets.constants.php
1656 */
1657define ('SOCKET_EPROTO', 71);
1658
1659/**
1660 * Multihop attempted.
1661 * @link http://www.php.net/manual/en/sockets.constants.php
1662 */
1663define ('SOCKET_EMULTIHOP', 72);
1664
1665/**
1666 * Not a data message.
1667 * @link http://www.php.net/manual/en/sockets.constants.php
1668 */
1669define ('SOCKET_EBADMSG', 74);
1670
1671/**
1672 * Name not unique on network.
1673 * @link http://www.php.net/manual/en/sockets.constants.php
1674 */
1675define ('SOCKET_ENOTUNIQ', 76);
1676
1677/**
1678 * File descriptor in bad state.
1679 * @link http://www.php.net/manual/en/sockets.constants.php
1680 */
1681define ('SOCKET_EBADFD', 77);
1682
1683/**
1684 * Remote address changed.
1685 * @link http://www.php.net/manual/en/sockets.constants.php
1686 */
1687define ('SOCKET_EREMCHG', 78);
1688
1689/**
1690 * Interrupted system call should be restarted.
1691 * @link http://www.php.net/manual/en/sockets.constants.php
1692 */
1693define ('SOCKET_ERESTART', 85);
1694
1695/**
1696 * Streams pipe error.
1697 * @link http://www.php.net/manual/en/sockets.constants.php
1698 */
1699define ('SOCKET_ESTRPIPE', 86);
1700
1701/**
1702 * Too many users.
1703 * @link http://www.php.net/manual/en/sockets.constants.php
1704 */
1705define ('SOCKET_EUSERS', 87);
1706
1707/**
1708 * Socket operation on non-socket.
1709 * @link http://www.php.net/manual/en/sockets.constants.php
1710 */
1711define ('SOCKET_ENOTSOCK', 88);
1712
1713/**
1714 * Destination address required.
1715 * @link http://www.php.net/manual/en/sockets.constants.php
1716 */
1717define ('SOCKET_EDESTADDRREQ', 89);
1718
1719/**
1720 * Message too long.
1721 * @link http://www.php.net/manual/en/sockets.constants.php
1722 */
1723define ('SOCKET_EMSGSIZE', 90);
1724
1725/**
1726 * Protocol wrong type for socket.
1727 * @link http://www.php.net/manual/en/sockets.constants.php
1728 */
1729define ('SOCKET_EPROTOTYPE', 91);
1730define ('SOCKET_ENOPROTOOPT', 92);
1731
1732/**
1733 * Protocol not supported.
1734 * @link http://www.php.net/manual/en/sockets.constants.php
1735 */
1736define ('SOCKET_EPROTONOSUPPORT', 93);
1737
1738/**
1739 * Socket type not supported.
1740 * @link http://www.php.net/manual/en/sockets.constants.php
1741 */
1742define ('SOCKET_ESOCKTNOSUPPORT', 94);
1743
1744/**
1745 * Operation not supported on transport endpoint.
1746 * @link http://www.php.net/manual/en/sockets.constants.php
1747 */
1748define ('SOCKET_EOPNOTSUPP', 95);
1749
1750/**
1751 * Protocol family not supported.
1752 * @link http://www.php.net/manual/en/sockets.constants.php
1753 */
1754define ('SOCKET_EPFNOSUPPORT', 96);
1755
1756/**
1757 * Address family not supported by protocol.
1758 * @link http://www.php.net/manual/en/sockets.constants.php
1759 */
1760define ('SOCKET_EAFNOSUPPORT', 97);
1761define ('SOCKET_EADDRINUSE', 98);
1762
1763/**
1764 * Cannot assign requested address.
1765 * @link http://www.php.net/manual/en/sockets.constants.php
1766 */
1767define ('SOCKET_EADDRNOTAVAIL', 99);
1768
1769/**
1770 * Network is down.
1771 * @link http://www.php.net/manual/en/sockets.constants.php
1772 */
1773define ('SOCKET_ENETDOWN', 100);
1774
1775/**
1776 * Network is unreachable.
1777 * @link http://www.php.net/manual/en/sockets.constants.php
1778 */
1779define ('SOCKET_ENETUNREACH', 101);
1780
1781/**
1782 * Network dropped connection because of reset.
1783 * @link http://www.php.net/manual/en/sockets.constants.php
1784 */
1785define ('SOCKET_ENETRESET', 102);
1786
1787/**
1788 * Software caused connection abort.
1789 * @link http://www.php.net/manual/en/sockets.constants.php
1790 */
1791define ('SOCKET_ECONNABORTED', 103);
1792
1793/**
1794 * Connection reset by peer.
1795 * @link http://www.php.net/manual/en/sockets.constants.php
1796 */
1797define ('SOCKET_ECONNRESET', 104);
1798
1799/**
1800 * No buffer space available.
1801 * @link http://www.php.net/manual/en/sockets.constants.php
1802 */
1803define ('SOCKET_ENOBUFS', 105);
1804
1805/**
1806 * Transport endpoint is already connected.
1807 * @link http://www.php.net/manual/en/sockets.constants.php
1808 */
1809define ('SOCKET_EISCONN', 106);
1810
1811/**
1812 * Transport endpoint is not connected.
1813 * @link http://www.php.net/manual/en/sockets.constants.php
1814 */
1815define ('SOCKET_ENOTCONN', 107);
1816
1817/**
1818 * Cannot send after transport endpoint shutdown.
1819 * @link http://www.php.net/manual/en/sockets.constants.php
1820 */
1821define ('SOCKET_ESHUTDOWN', 108);
1822
1823/**
1824 * Too many references: cannot splice.
1825 * @link http://www.php.net/manual/en/sockets.constants.php
1826 */
1827define ('SOCKET_ETOOMANYREFS', 109);
1828
1829/**
1830 * Connection timed out.
1831 * @link http://www.php.net/manual/en/sockets.constants.php
1832 */
1833define ('SOCKET_ETIMEDOUT', 110);
1834
1835/**
1836 * Connection refused.
1837 * @link http://www.php.net/manual/en/sockets.constants.php
1838 */
1839define ('SOCKET_ECONNREFUSED', 111);
1840
1841/**
1842 * Host is down.
1843 * @link http://www.php.net/manual/en/sockets.constants.php
1844 */
1845define ('SOCKET_EHOSTDOWN', 112);
1846
1847/**
1848 * No route to host.
1849 * @link http://www.php.net/manual/en/sockets.constants.php
1850 */
1851define ('SOCKET_EHOSTUNREACH', 113);
1852
1853/**
1854 * Operation already in progress.
1855 * @link http://www.php.net/manual/en/sockets.constants.php
1856 */
1857define ('SOCKET_EALREADY', 114);
1858
1859/**
1860 * Operation now in progress.
1861 * @link http://

Large files files are truncated, but you can click here to view the full file