summaryrefslogtreecommitdiff
path: root/ext/sockets/sockets.stub.php
blob: 42abd805b6f044b01690bb4bb903b4a474e85371 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<?php

/** @return int|false */
function socket_select(?array &$read_fds, ?array &$write_fds, ?array &$except_fds, ?int $tv_sec, int $tv_usec = 0) {}

/** @return resource|false */
function socket_create_listen(int $port, int $backlog = 128) {}

/**
 * @param resource $socket
 *
 * @return resource|false
 */
function socket_accept($socket) {}

/** @param resource $socket */
function socket_set_nonblock($socket): bool {}

/** @param resource $socket */
function socket_set_block($socket): bool {}

/** @param resource $socket */
function socket_listen($socket, int $backlog = 0): bool {}

/** @param resource $socket */
function socket_close($socket): void {}

/**
 * @param resource $socket
 * 
 * @return int|false
 */
function socket_write($socket, string $buf, int $length = 0) {}

/**
 * @param resource $socket
 * 
 * @return string|false
 */
function socket_read($socket, int $length, int $type = PHP_BINARY_READ) {}

/** @param resource $socket */
function socket_getsockname($socket, &$addr, &$port = UNKNOWN): bool {}

/** @param resource $socket */
function socket_getpeername($socket, &$addr, &$port = UNKNOWN): bool {}

/** @return resource|false */
function socket_create(int $domain, int $type, int $protocol) {}

/** @param resource $socket */
function socket_connect($socket, string $addr, int $port = 0): bool {}

function socket_strerror(int $errno): string {}

/** @param resource $socket */
function socket_bind($socket, string $addr, int $port = 0): bool {}

/**
 * @param resource $socket
 * 
 * @return int|false
 */
function socket_recv($socket, &$buf, int $len, int $flags) {}

/**
 * @param resource $socket
 * 
 * @return int|false
 */
function socket_send($socket, string $buf, int $len, int $flags) {}

/**
 * @param resource $socket
 * 
 * @return int|false
 */
function socket_recvfrom($socket, &$buf, int $len, int $flags, &$name, &$port = UNKNOWN) {}

/**
 * @param resource $socket
 * 
 * @return int|false
 */
function socket_sendto($socket, string $buf, int $len, int $flags, string $addr, int $port = 0) {}

/**
 * @param resource $socket
 * 
 * @return array|int|false
 */
function socket_get_option($socket, int $level, int $optname) {}

/** @param resource $socket */
function socket_set_option($socket, int $level, int $optname, $optval): bool {}

#ifdef HAVE_SOCKETPAIR
/** @return bool|null */
function socket_create_pair(int $domain, int $type, int $protocol, &$fd) {}
#endif

#ifdef HAVE_SHUTDOWN
/** @param resource $socket */
function socket_shutdown($socket, int $how = 2): bool {}
#endif

/** @param resource $socket */
function socket_last_error($socket = UNKNOWN): int {}

/** @param resource $socket */
function socket_clear_error($socket = UNKNOWN): void {}

/**
 * @param resource $stream
 * 
 * @return resource|false
 */
function socket_import_stream($stream) {}

/** @param resource $socket */
function socket_export_stream($socket) {}

/**
 * @param resource $socket
 * 
 * @return int|false
 */
function socket_sendmsg($socket, array $msghdr, int $flags = 0) {}

/**
 * @param resource $socket
 * 
 * @return int|false
 */
function socket_recvmsg($socket, array &$msghdr, int $flags = 0) {}

function socket_cmsg_space(int $level, int $type, int $n = 0): ?int {}

/** @return array|false */
function socket_addrinfo_lookup(string $host, string $service = UNKNOWN, array $hints = UNKNOWN) {}

/**
 * @param resource $addr
 * 
 * @return resource|false
 */
function socket_addrinfo_connect($addr) {}

/**
 * @param resource $addr
 * 
 * @return resource|false
 */
function socket_addrinfo_bind($addr) {}

/** @param resource $addr */
function socket_addrinfo_explain($addr): array {}

#ifdef PHP_WIN32
/**
 * @param resource $socket
 * 
 * @return string|false
 */
function socket_wsaprotocol_info_export($socket, int $target_pid) {}

/**
 * @return resource|false
 */
function socket_wsaprotocol_info_import(string $info_id) {}

function socket_wsaprotocol_info_release(string $info_id): bool {}
#endif