2012年4月28日

Error Handling: Wrapper Functions

摘要: Error Handling: Wrapper Functions In any real-world program, it is essential to check every function call for an error return. In Figure 1.5, we check for errors from socket, inet_pton, connect, read,... 阅读全文

posted @ 2012-04-28 17:40 D_D_U 阅读(315) 评论(0) 推荐(0) 编辑

Host Names

摘要: Host Names Besides the standard numbers-and-dots notation for Internet addresses, you can also refer to a host by a symbolic name. The advantage of a symbolic name is that it is usually easier ... 阅读全文

posted @ 2012-04-28 11:07 D_D_U 阅读(295) 评论(0) 推荐(0) 编辑

Host Address Data Type

摘要: Host Address Data Type IPv4 Internet host addresses are represented in some contexts as integers (type uint32_t). In other contexts, the integer is packaged inside a structure of type struct in_a... 阅读全文

posted @ 2012-04-28 10:46 D_D_U 阅读(293) 评论(0) 推荐(0) 编辑

Byte Order Conversion

摘要: Byte Order Conversion Different kinds of computers use different conventions for the ordering of bytes within a word. Some computers put the most significant byte within a word first (this is ... 阅读全文

posted @ 2012-04-28 10:25 D_D_U 阅读(313) 评论(0) 推荐(0) 编辑

Socket Address Structures

摘要: Socket Address Structures Most socket functions require a pointer to a socket address structure as an argument. Each supported protocol suite defines its own socket address structure. The names of th... 阅读全文

posted @ 2012-04-28 10:11 D_D_U 阅读(267) 评论(0) 推荐(0) 编辑

Creating a Socket -----int socket (int namespace, int style, int protocol)

摘要: socket Function To perform network I/O, the first thing a process must do is call the socket function, specifying the type of communication protocol desired (TCP using IPv4, UDP using IPv6, Unix doma... 阅读全文

posted @ 2012-04-28 10:00 D_D_U 阅读(612) 评论(0) 推荐(0) 编辑

导航