php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
sockets.c File Reference
#include "php.h"
#include "php_network.h"
#include "ext/standard/file.h"
#include "ext/standard/info.h"
#include "php_ini.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <sys/un.h>
#include <arpa/inet.h>
#include <sys/time.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <sys/uio.h>
#include "php_sockets.h"
#include <stddef.h>
#include "sockaddr_conv.h"
#include "multicast.h"
#include "sendrecvmsg.h"
#include "sockets_arginfo.h"

Go to the source code of this file.

Data Structures

struct  php_addrinfo
 

Macros

#define set_errno(a)
 
#define SUN_LEN_NO_UB(su)
 
#define SUN_LEN(su)
 
#define PF_INET   AF_INET
 
#define Z_ADDRESS_INFO_P(zv)
 
#define HANDLE_SUBCALL(res)
 

Functions

char * sockets_strerror (int error)
 
 PHP_FUNCTION (socket_select)
 
 PHP_FUNCTION (socket_create_listen)
 
 PHP_FUNCTION (socket_accept)
 
 PHP_FUNCTION (socket_set_nonblock)
 
 PHP_FUNCTION (socket_set_block)
 
 PHP_FUNCTION (socket_listen)
 
 PHP_FUNCTION (socket_close)
 
 PHP_FUNCTION (socket_write)
 
 PHP_FUNCTION (socket_read)
 
 PHP_FUNCTION (socket_getsockname)
 
 PHP_FUNCTION (socket_getpeername)
 
 PHP_FUNCTION (socket_create)
 
 PHP_FUNCTION (socket_connect)
 
 PHP_FUNCTION (socket_strerror)
 
 PHP_FUNCTION (socket_bind)
 
 PHP_FUNCTION (socket_recv)
 
 PHP_FUNCTION (socket_send)
 
 PHP_FUNCTION (socket_recvfrom)
 
 PHP_FUNCTION (socket_sendto)
 
 PHP_FUNCTION (socket_get_option)
 
 PHP_FUNCTION (socket_set_option)
 
 PHP_FUNCTION (socket_last_error)
 
 PHP_FUNCTION (socket_clear_error)
 
bool socket_import_file_descriptor (PHP_SOCKET socket, php_socket *retsock)
 
 PHP_FUNCTION (socket_import_stream)
 
 PHP_FUNCTION (socket_export_stream)
 
 PHP_FUNCTION (socket_addrinfo_lookup)
 
 PHP_FUNCTION (socket_addrinfo_bind)
 
 PHP_FUNCTION (socket_addrinfo_connect)
 
 PHP_FUNCTION (socket_addrinfo_explain)
 

Variables

zend_class_entrysocket_ce
 
zend_class_entryaddress_info_ce
 
zend_module_entry sockets_module_entry
 

Macro Definition Documentation

◆ HANDLE_SUBCALL

#define HANDLE_SUBCALL ( res)
Value:
do { \
if (res == 1) { goto default_case; } \
else if (res == SUCCESS) { RETURN_TRUE; } \
else { RETURN_FALSE; } \
} while (0)
zend_string * res
Definition ffi.c:4692
#define SUCCESS
Definition hash_sha3.c:261
#define RETURN_FALSE
Definition zend_API.h:1058
#define RETURN_TRUE
Definition zend_API.h:1059

◆ PF_INET

#define PF_INET   AF_INET

Definition at line 91 of file sockets.c.

◆ set_errno

#define set_errno ( a)
Value:
(errno = a)
$obj a
Definition test.php:84
#define errno

Definition at line 52 of file sockets.c.

◆ SUN_LEN

#define SUN_LEN ( su)
Value:
#define SUN_LEN_NO_UB(su)
Definition sockets.c:78

Definition at line 87 of file sockets.c.

◆ SUN_LEN_NO_UB

#define SUN_LEN_NO_UB ( su)
Value:
(sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
strlen(string $string)

Definition at line 78 of file sockets.c.

◆ Z_ADDRESS_INFO_P

#define Z_ADDRESS_INFO_P ( zv)
Value:
address_info_from_obj(Z_OBJ_P(zv))
zval * zv
Definition ffi.c:3975
#define Z_OBJ_P(zval_p)
Definition zend_types.h:990

Definition at line 165 of file sockets.c.

Function Documentation

◆ PHP_FUNCTION() [1/29]

PHP_FUNCTION ( socket_accept )

Definition at line 697 of file sockets.c.

◆ PHP_FUNCTION() [2/29]

PHP_FUNCTION ( socket_addrinfo_bind )

Definition at line 2544 of file sockets.c.

◆ PHP_FUNCTION() [3/29]

PHP_FUNCTION ( socket_addrinfo_connect )

Definition at line 2607 of file sockets.c.

◆ PHP_FUNCTION() [4/29]

PHP_FUNCTION ( socket_addrinfo_explain )

Definition at line 2670 of file sockets.c.

◆ PHP_FUNCTION() [5/29]

PHP_FUNCTION ( socket_addrinfo_lookup )

Definition at line 2474 of file sockets.c.

◆ PHP_FUNCTION() [6/29]

PHP_FUNCTION ( socket_bind )

Definition at line 1265 of file sockets.c.

◆ PHP_FUNCTION() [7/29]

PHP_FUNCTION ( socket_clear_error )

Definition at line 2268 of file sockets.c.

◆ PHP_FUNCTION() [8/29]

PHP_FUNCTION ( socket_close )

Definition at line 820 of file sockets.c.

◆ PHP_FUNCTION() [9/29]

PHP_FUNCTION ( socket_connect )

Definition at line 1155 of file sockets.c.

◆ PHP_FUNCTION() [10/29]

PHP_FUNCTION ( socket_create )

Definition at line 1101 of file sockets.c.

◆ PHP_FUNCTION() [11/29]

PHP_FUNCTION ( socket_create_listen )

Definition at line 672 of file sockets.c.

◆ PHP_FUNCTION() [12/29]

PHP_FUNCTION ( socket_export_stream )

Definition at line 2378 of file sockets.c.

◆ PHP_FUNCTION() [13/29]

PHP_FUNCTION ( socket_get_option )

Definition at line 1642 of file sockets.c.

◆ PHP_FUNCTION() [14/29]

PHP_FUNCTION ( socket_getpeername )

Definition at line 1027 of file sockets.c.

◆ PHP_FUNCTION() [15/29]

PHP_FUNCTION ( socket_getsockname )

Definition at line 956 of file sockets.c.

◆ PHP_FUNCTION() [16/29]

PHP_FUNCTION ( socket_import_stream )

Definition at line 2333 of file sockets.c.

◆ PHP_FUNCTION() [17/29]

PHP_FUNCTION ( socket_last_error )

Definition at line 2246 of file sockets.c.

◆ PHP_FUNCTION() [18/29]

PHP_FUNCTION ( socket_listen )

Definition at line 796 of file sockets.c.

◆ PHP_FUNCTION() [19/29]

PHP_FUNCTION ( socket_read )

Definition at line 899 of file sockets.c.

◆ PHP_FUNCTION() [20/29]

PHP_FUNCTION ( socket_recv )

Definition at line 1349 of file sockets.c.

◆ PHP_FUNCTION() [21/29]

PHP_FUNCTION ( socket_recvfrom )

Definition at line 1428 of file sockets.c.

◆ PHP_FUNCTION() [22/29]

PHP_FUNCTION ( socket_select )

Definition at line 589 of file sockets.c.

◆ PHP_FUNCTION() [23/29]

PHP_FUNCTION ( socket_send )

Definition at line 1393 of file sockets.c.

◆ PHP_FUNCTION() [24/29]

PHP_FUNCTION ( socket_sendto )

Definition at line 1551 of file sockets.c.

◆ PHP_FUNCTION() [25/29]

PHP_FUNCTION ( socket_set_block )

Definition at line 758 of file sockets.c.

◆ PHP_FUNCTION() [26/29]

PHP_FUNCTION ( socket_set_nonblock )

Definition at line 722 of file sockets.c.

◆ PHP_FUNCTION() [27/29]

PHP_FUNCTION ( socket_set_option )

Definition at line 1851 of file sockets.c.

◆ PHP_FUNCTION() [28/29]

PHP_FUNCTION ( socket_strerror )

Definition at line 1247 of file sockets.c.

◆ PHP_FUNCTION() [29/29]

PHP_FUNCTION ( socket_write )

Definition at line 854 of file sockets.c.

◆ socket_import_file_descriptor()

bool socket_import_file_descriptor ( PHP_SOCKET socket,
php_socket * retsock )

Definition at line 2291 of file sockets.c.

◆ sockets_strerror()

char * sockets_strerror ( int error)

Definition at line 367 of file sockets.c.

Variable Documentation

◆ address_info_ce

zend_class_entry* address_info_ce

Definition at line 158 of file sockets.c.

◆ socket_ce

zend_class_entry* socket_ce

Definition at line 103 of file sockets.c.

◆ sockets_module_entry

zend_module_entry sockets_module_entry
Initial value:
= {
"sockets",
ext_functions,
PHP_MINIT(sockets),
PHP_MSHUTDOWN(sockets),
PHP_RSHUTDOWN(sockets),
PHP_MINFO(sockets),
PHP_SOCKETS_VERSION,
PHP_GINIT(sockets),
PHP_GSHUTDOWN(sockets),
}
#define NULL
Definition gdcache.h:45
#define PHP_GINIT
Definition php.h:397
#define PHP_MINFO
Definition php.h:396
#define PHP_MSHUTDOWN
Definition php.h:393
#define PHP_RSHUTDOWN
Definition php.h:395
#define PHP_MINIT
Definition php.h:392
#define PHP_MODULE_GLOBALS
Definition php.h:408
#define PHP_GSHUTDOWN
Definition php.h:398
#define STANDARD_MODULE_HEADER
#define STANDARD_MODULE_PROPERTIES_EX

Definition at line 195 of file sockets.c.