XCVII. Socket functions

Introductie

Waarschuwing

Deze module is EXPERIMENTEEL . Dat betekent , dat het gedrag van deze functies , deze functienamen , in concreto ALLES dat hier gedocumenteerd is in een toekomstige uitgave van PHP ZONDER WAARSCHUWING kan veranderen . Wees gewaarschuwd , en gebruik deze module op eigen risico .

Afhankelijkheden

Deze functies zijn beschikbaar als onderdeel van de standard module die altijd beschikbaar is .

Installatie

Configuratie tijdens scriptuitvoer

Deze extensie gebruikt geen configuratie regels .

Resource types

Deze extensie maakt geen gebruik van resources .

Voorgedefineerde constanten

Deze constanten worden gedefineerd door deze extensie , en zullen alleen beschikbaar zijn als de extensie met PHP is meegecompileerd , of als deze dynamisch is geladen vanuit een script .

AF_UNIX ( integer )

AF_INET ( integer )

SOCK_STREAM ( integer )

SOCK_DGRAM ( integer )

SOCK_RAW ( integer )

SOCK_SEQPACKET ( integer )

SOCK_RDM ( integer )

MSG_OOB ( integer )

MSG_WAITALL ( integer )

MSG_PEEK ( integer )

MSG_DONTROUTE ( integer )

SO_DEBUG ( integer )

SO_REUSEADDR ( integer )

SO_KEEPALIVE ( integer )

SO_DONTROUTE ( integer )

SO_LINGER ( integer )

SO_BROADCAST ( integer )

SO_OOBINLINE ( integer )

SO_SNDBUF ( integer )

SO_RCVBUF ( integer )

SO_SNDLOWAT ( integer )

SO_RCVLOWAT ( integer )

SO_SNDTIMEO ( integer )

SO_RCVTIMEO ( integer )

SO_TYPE ( integer )

SO_ERROR ( integer )

SOL_SOCKET ( integer )

PHP_NORMAL_READ ( integer )

PHP_BINARY_READ ( integer )

SOL_TCP ( integer )

SOL_UDP ( integer )

Socket Errors

Opmerking :










Voorbeelden

Voorbeeld 1 .














Voorbeeld 2 .






Inhoudsopgave
socket_accept -- Accepts a connection on a socket
socket_bind -- Binds a name to a socket
socket_clear_error -- Clears the error on the socket or the last error code
socket_close -- Closes a socket resource
socket_connect -- Initiates a connection on a socket
socket_create_listen -- Opens a socket on port to accept connections
socket_create_pair -- Creates a pair of indistinguishable sockets and stores them in fds.
socket_create -- Create a socket (endpoint for communication)
socket_get_option -- Gets socket options for the socket
socket_getpeername -- 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.
socket_getsockname -- 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.
socket_iovec_add -- Adds a new vector to the scatter/gather array
socket_iovec_alloc -- ...]) Builds a 'struct iovec' for use with sendmsg, recvmsg, writev, and readv
socket_iovec_delete -- Deletes a vector from an array of vectors
socket_iovec_fetch -- Returns the data held in the iovec specified by iovec_id[iovec_position]
socket_iovec_free -- Frees the iovec specified by iovec_id
socket_iovec_set -- Sets the data held in iovec_id[iovec_position] to new_val
socket_last_error -- Returns the last error on the socket
socket_listen -- Listens for a connection on a socket
socket_read -- Reads a maximum of length bytes from a socket
socket_readv -- Reads from an fd, using the scatter-gather array defined by iovec_id
socket_recv -- Receives data from a connected socket
socket_recvfrom -- Receives data from a socket, connected or not
socket_recvmsg -- Used to receive messages on a socket, whether connection-oriented or not
socket_select -- Runs the select() system call on the given arrays of sockets with a timeout specified by tv_sec and tv_usec
socket_send -- Sends data to a connected socket
socket_sendmsg -- Sends a message to a socket, regardless of whether it is connection-oriented or not
socket_sendto -- Sends a message to a socket, whether it is connected or not
socket_set_nonblock -- Sets nonblocking mode for file descriptor fd
socket_set_option -- Sets socket options for the socket
socket_shutdown -- Shuts down a socket for receiving, sending, or both.
socket_strerror -- Return a string describing a socket error
socket_write -- Write to a socket
socket_writev -- Writes to a file descriptor, fd, using the scatter-gather array defined by iovec_id