reference/sockets/functions/socket-create.xml
a871ef72edf436c59422dedd538594db2541d5f1
...
...
@@ -1,6 +1,6 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.socket-create">
3
+
<refentry xml:id="function.socket-create" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>socket_create</refname>
6
6
<refpurpose>Create a socket (endpoint for communication)</refpurpose>
...
...
@@ -9,13 +9,13 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>resource</type><methodname>socket_create</methodname>
12
+
<type class="union"><type>Socket</type><type>false</type></type><methodname>socket_create</methodname>
13
13
<methodparam><type>int</type><parameter>domain</parameter></methodparam>
14
14
<methodparam><type>int</type><parameter>type</parameter></methodparam>
15
15
<methodparam><type>int</type><parameter>protocol</parameter></methodparam>
16
16
</methodsynopsis>
17
17
<para>
18
-
Creates and returns a socket resource, also referred to as an endpoint
18
+
Creates and returns a <classname>Socket</classname> instance, also referred to as an endpoint
19
19
of communication. A typical network connection is made up of 2 sockets, one
20
20
performing the role of the client, and another performing the role of the server.
21
21
</para>
...
...
@@ -192,7 +192,7 @@
192
192
<refsect1 role="returnvalues">
193
193
&reftitle.returnvalues;
194
194
<para>
195
-
<function>socket_create</function> returns a socket resource on success,
195
+
<function>socket_create</function> returns a <classname>Socket</classname> instance on success,
196
196
or &false; on error. The actual error code can be retrieved by calling
197
197
<function>socket_last_error</function>. This error code may be passed to
198
198
<function>socket_strerror</function> to get a textual explanation of the
...
...
@@ -202,13 +202,36 @@
202
202

203
203
<refsect1 role="errors">
204
204
&reftitle.errors;
205
-
<para>
206
-
If an invalid <parameter>domain</parameter> or
207
-
<parameter>type</parameter> is given, <function>socket_create</function>
208
-
defaults to <constant>AF_INET</constant> and
209
-
<constant>SOCK_STREAM</constant> respectively and additionally emits an
210
-
<constant>E_WARNING</constant> message.
211
-
</para>
205
+
<para>
206
+
If an invalid <parameter>domain</parameter> or
207
+
<parameter>type</parameter> is given, <function>socket_create</function>
208
+
defaults to <constant>AF_INET</constant> and
209
+
<constant>SOCK_STREAM</constant> respectively and additionally emits an
210
+
<constant>E_WARNING</constant> message.
211
+
</para>
212
+
</refsect1>
213
+

214
+
<refsect1 role="changelog">
215
+
&reftitle.changelog;
216
+
<informaltable>
217
+
<tgroup cols="2">
218
+
<thead>
219
+
<row>
220
+
<entry>&Version;</entry>
221
+
<entry>&Description;</entry>
222
+
</row>
223
+
</thead>
224
+
<tbody>
225
+
<row>
226
+
<entry>8.0.0</entry>
227
+
<entry>
228
+
On success, this function returns a <classname>Socket</classname> instance now;
229
+
previously, a <type>resource</type> was returned.
230
+
</entry>
231
+
</row>
232
+
</tbody>
233
+
</tgroup>
234
+
</informaltable>
212
235
</refsect1>
213
236

214
237
<refsect1 role="seealso">
...
...
@@ -226,7 +249,6 @@
226
249
</refsect1>
227
250

228
251
</refentry>
229
-

230
252
<!-- Keep this comment at the end of the file
231
253
Local variables:
232
254
mode: sgml
233
255