摘要: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,...
阅读全文
摘要: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 ...
阅读全文
摘要: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...
阅读全文
摘要: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 ...
阅读全文
摘要: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...
阅读全文