F.34. Sockets
Function | Returns | Description |
---|---|---|
socket_select(array &read_fds, array &write_fds, &array except_fds, int tv_sec[, int tv_usec]) | int | Runs the select() system call on the sets mentioned with a timeout specified by tv_sec and tv_usec. |
socket_create_listen(int port[, int backlog]) | resource | Opens a socket on port to accept connections. |
socket_accept(resource socket) | resource | Accepts a connection on the listening socket fd. |
socket_set_nonblock(resource socket) | bool | Sets nonblocking mode on a socket resource. |
socket_set_block(resource socket) | bool | Sets blocking mode on a socket resource. |
socket_listen(resource socket[, int backlog]) | bool | Sets the maximum number of connections allowed to be waited for on the socket specified by fd. |
socket_close(resource socket) | void | Closes a file descriptor. |
socket_write(resource socket, string buf[, int length]) | int | Writes the buffer to the socket resource; length is optional. |
socket_read(resource socket, int length [, int type]) | string | Reads a maximum of length bytes from socket. |
socket_getsockname(resource socket, string &addr[, int &port]) | bool | 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_getpeername(resource socket, string &addr[, int &port]) | bool | 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_create(int domain, int type, int protocol) | resource | Creates an endpoint ... |
Get Web Standards Programmer's Reference: HTML, CSS, JavaScript®, Perl, Python®, and PHP now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.