-
Notifications
You must be signed in to change notification settings - Fork 105
/
Copy patherrors.xml
46 lines (45 loc) · 1.87 KB
/
errors.xml
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
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: f453f7036c74f5f8ce5e15d3d5abbaf8dfd599e2 Maintainer: Carbyn Wu Status: ready -->
<chapter xml:id="sockets.errors" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Socket Errors</title>
<para>
Socket 扩展编写的目的是为功能强大的 BSD Socket 提供可用的接口。它能确保这些函数在 Win32 和 Unix
平台上都能很好的工作。在特定条件下,大部分 socket 函数如果发生错误都会发出一个 <constant>E_WARNING</constant>
消息描述错误内容。有时可能并不会如开发者所愿。例如,因为连接突然中断,<function>socket_read</function>
函数可能会突然发出一个 <constant>E_WARNING</constant> 消息。通常会使用 <literal>@</literal>
操作符来压制异常,然后在程序中用 <function>socket_last_error</function> 来捕获错误代码。可以调用
<function>socket_strerror</function> 函数通过错误代码获取错误描述。查看函数描述获取更多信息。
</para>
<note>
<para>
Socket 扩展发出的 <constant>E_WARNING</constant>
信息都是英文的,但获取到的错误描述会根据当前区域(<constant>LC_MESSAGES</constant>)展示:
<screen>
<![CDATA[
Warning - socket_bind() unable to bind address [98]: Die Adresse wird bereits verwendet
]]>
</screen>
</para>
</note>
</chapter>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->