Phpsocket function list

Source: Internet
Author: User
Phpsocket function list
This article shares common functions in the php socket function library. if you have any friends who are studying php socket programming, refer to this document.

Php socket function library:

Function name description socket_accept () accept a Socket connection socket_bind () bind the socket to an IP address and port socket_clear_error () to clear the socket error or the final error code socket_close () close a socket resource socket_connect () and start a socket connection socket_create_listen () open a socket at the specified port to listen to socket_create_pair () and generate a No difference socket to an array socket_create () generate a socket, which is equivalent to generate a data structure of a socket. socket_get_option () obtain the socket option socket_getpeername () obtain the IP address of a remote host similar to socket_getsockname () obtain the IP address of the local socket socket_iovec () add a new vector to a distributed/aggregated array socket_iovec_alloc (). This function creates an iovec data structure socket_iovec_delete () that can send and receive read/write data to delete an allocated iovecsocket_iovec_fetch () return the data socket_iovec_free () of the specified iovec resource to release an iovec resource socket_iovec_set (). set the new value of iovec data socket_last_error () to get the final error code socket_listen () of the current socket () listen to the et_recv () listener for reading data of the specified length from all connections of the specified socket socket_read () to read data of the specified length from the scattered/aggregated array socket_recv () from the socket end data to the cache socket_recvfrom () accept data from the specified socket. if not specified, the current socketsocket_recvmsg () receives the socket_select () et_send () message from iovec by default. this function sends data to the connected socketsocket_sendmsg () send a message to socketsocket_sendto () and send the message to socketsocket_set_block () at the specified address. set it to block mode socket_set_nonblock () in socket and set it to non-block mode socket_set_option () this function allows you to disable read, write, or specify socketsocket_strerror () to return the detailed error socket_write () of the specified error code to write data to the socket cache socket_writev () to write data to the scattered/aggregate array

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.