PageRenderTime 4ms CodeModel.GetById 2ms app.highlight 17ms RepoModel.GetById 1ms app.codeStats 1ms

/.metadata/.plugins/org.eclipse.php.core/__language__/a601fd1b/sockets.php

https://github.com/sad1990/--
PHP | 1370 lines | 129 code | 34 blank | 1207 comment | 0 complexity | ccfc3c436fdb4f6ae3d76d20e9f0920b MD5 | raw 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 than 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 * Import a stream
1212 * @link http://www.php.net/manual/en/function.socket-import-stream.php
1213 * @param stream resource <p>
1214 * The stream resource to import.
1215 * </p>
1216 * @return resource false or &null; on failure.
1217 */
1218function socket_import_stream ($stream) {}
1219
1220/**
1221 * Send a message
1222 * @link http://www.php.net/manual/en/function.socket-sendmsg.php
1223 * @param socket resource <p>
1224 * </p>
1225 * @param message array <p>
1226 * </p>
1227 * @param flags int <p>
1228 * </p>
1229 * @return int 
1230 */
1231function socket_sendmsg ($socket, array $message, $flags) {}
1232
1233/**
1234 * Read a message
1235 * @link http://www.php.net/manual/en/function.socket-recvmsg.php
1236 * @param socket resource <p>
1237 * </p>
1238 * @param message string <p>
1239 * </p>
1240 * @param flags int[optional] <p>
1241 * </p>
1242 * @return int 
1243 */
1244function socket_recvmsg ($socket, $message, $flags = null) {}
1245
1246/**
1247 * Calculate message buffer size
1248 * @link http://www.php.net/manual/en/function.socket-cmsg-space.php
1249 * @param level int <p>
1250 * </p>
1251 * @param type int <p>
1252 * </p>
1253 * @return int 
1254 */
1255function socket_cmsg_space ($level, $type) {}
1256
1257/**
1258 * @param socket
1259 * @param level
1260 * @param optname
1261 */
1262function socket_getopt ($socket, $level, $optname) {}
1263
1264/**
1265 * @param socket
1266 * @param level
1267 * @param optname
1268 * @param optval
1269 */
1270function socket_setopt ($socket, $level, $optname, $optval) {}
1271
1272define ('AF_UNIX', 1);
1273define ('AF_INET', 2);
1274define ('SOCK_STREAM', 1);
1275define ('SOCK_DGRAM', 2);
1276define ('SOCK_RAW', 3);
1277define ('SOCK_SEQPACKET', 5);
1278define ('SOCK_RDM', 4);
1279define ('MSG_OOB', 1);
1280define ('MSG_WAITALL', 8);
1281define ('MSG_CTRUNC', 512);
1282define ('MSG_TRUNC', 256);
1283define ('MSG_PEEK', 2);
1284define ('MSG_DONTROUTE', 4);
1285define ('SO_DEBUG', 1);
1286define ('SO_REUSEADDR', 4);
1287define ('SO_KEEPALIVE', 8);
1288define ('SO_DONTROUTE', 16);
1289define ('SO_LINGER', 128);
1290define ('SO_BROADCAST', 32);
1291define ('SO_OOBINLINE', 256);
1292define ('SO_SNDBUF', 4097);
1293define ('SO_RCVBUF', 4098);
1294define ('SO_SNDLOWAT', 4099);
1295define ('SO_RCVLOWAT', 4100);
1296define ('SO_SNDTIMEO', 4101);
1297define ('SO_RCVTIMEO', 4102);
1298define ('SO_TYPE', 4104);
1299define ('SO_ERROR', 4103);
1300define ('SOL_SOCKET', 65535);
1301define ('SOMAXCONN', 2147483647);
1302define ('TCP_NODELAY', 1);
1303define ('PHP_NORMAL_READ', 1);
1304define ('PHP_BINARY_READ', 2);
1305define ('MCAST_JOIN_GROUP', 41);
1306define ('MCAST_LEAVE_GROUP', 42);
1307define ('MCAST_BLOCK_SOURCE', 43);
1308define ('MCAST_UNBLOCK_SOURCE', 44);
1309define ('MCAST_JOIN_SOURCE_GROUP', 45);
1310define ('MCAST_LEAVE_SOURCE_GROUP', 46);
1311define ('IP_MULTICAST_IF', 9);
1312define ('IP_MULTICAST_TTL', 10);
1313define ('IP_MULTICAST_LOOP', 11);
1314define ('SOCKET_EINTR', 10004);
1315define ('SOCKET_EBADF', 10009);
1316define ('SOCKET_EACCES', 10013);
1317define ('SOCKET_EFAULT', 10014);
1318define ('SOCKET_EINVAL', 10022);
1319define ('SOCKET_EMFILE', 10024);
1320define ('SOCKET_EWOULDBLOCK', 10035);
1321define ('SOCKET_EINPROGRESS', 10036);
1322define ('SOCKET_EALREADY', 10037);
1323define ('SOCKET_ENOTSOCK', 10038);
1324define ('SOCKET_EDESTADDRREQ', 10039);
1325define ('SOCKET_EMSGSIZE', 10040);
1326define ('SOCKET_EPROTOTYPE', 10041);
1327define ('SOCKET_ENOPROTOOPT', 10042);
1328define ('SOCKET_EPROTONOSUPPORT', 10043);
1329define ('SOCKET_ESOCKTNOSUPPORT', 10044);
1330define ('SOCKET_EOPNOTSUPP', 10045);
1331define ('SOCKET_EPFNOSUPPORT', 10046);
1332define ('SOCKET_EAFNOSUPPORT', 10047);
1333define ('SOCKET_EADDRINUSE', 10048);
1334define ('SOCKET_EADDRNOTAVAIL', 10049);
1335define ('SOCKET_ENETDOWN', 10050);
1336define ('SOCKET_ENETUNREACH', 10051);
1337define ('SOCKET_ENETRESET', 10052);
1338define ('SOCKET_ECONNABORTED', 10053);
1339define ('SOCKET_ECONNRESET', 10054);
1340define ('SOCKET_ENOBUFS', 10055);
1341define ('SOCKET_EISCONN', 10056);
1342define ('SOCKET_ENOTCONN', 10057);
1343define ('SOCKET_ESHUTDOWN', 10058);
1344define ('SOCKET_ETOOMANYREFS', 10059);
1345define ('SOCKET_ETIMEDOUT', 10060);
1346define ('SOCKET_ECONNREFUSED', 10061);
1347define ('SOCKET_ELOOP', 10062);
1348define ('SOCKET_ENAMETOOLONG', 10063);
1349define ('SOCKET_EHOSTDOWN', 10064);
1350define ('SOCKET_EHOSTUNREACH', 10065);
1351define ('SOCKET_ENOTEMPTY', 10066);
1352define ('SOCKET_EPROCLIM', 10067);
1353define ('SOCKET_EUSERS', 10068);
1354define ('SOCKET_EDQUOT', 10069);
1355define ('SOCKET_ESTALE', 10070);
1356define ('SOCKET_EREMOTE', 10071);
1357define ('SOCKET_EDISCON', 10101);
1358define ('SOCKET_SYSNOTREADY', 10091);
1359define ('SOCKET_VERNOTSUPPORTED', 10092);
1360define ('SOCKET_NOTINITIALISED', 10093);
1361define ('SOCKET_HOST_NOT_FOUND', 11001);
1362define ('SOCKET_TRY_AGAIN', 11002);
1363define ('SOCKET_NO_RECOVERY', 11003);
1364define ('SOCKET_NO_DATA', 11004);
1365define ('SOCKET_NO_ADDRESS', 11004);
1366define ('IPPROTO_IP', 0);
1367define ('SOL_TCP', 6);
1368define ('SOL_UDP', 17);
1369
1370// End of sockets v.