Terminology and (Shared web hosting) Portability Terminology and Portability ; int
Friday, August 31st, 2007Terminology and Portability Terminology and Portability ; int salen; foo(sa, salen) 2. To have a switch statement to determine length of sockaddr. With this approach, however, the application will not be able to support sockaddrs with unknown address family. struct sockaddr *sa; int salen; switch (sa->sa_family) { case AF_INET: salen = sizeof(sockaddr_in); break; case AF_INET6: salen = sizeof(struct sockaddr_in6); break default: fprintf(stderr, not supportedn ); exit(1); /*NOTREACHED*/ } Missing Type for Variables In some cases, your platform may not have the type declaration used in this book. In such cases, use the following: If socklen_t is not defined such as older *BSD releases: Use unsigned int instead. If in_port_t is not present: Use u_int16_t. If u_int8_t, u_int16_t, and u_int32_t are not found: If your system has /usr/include/inttypes.h (which is defined in the recent C language standard), you may use uint8_t, uint16_t, or uint32_t, respectively, after #include
If you need complete web hosting solution you come to right place,try mac web hosting services.