Next: , Up: Steps in Implementing an Insecure HTTP Client   [Index]


1.3.1.1 Implementing the HTTP Client Header—Includes—Defines

Start with all of the #include’s and #define’s that go along with socket communication, shown in Listing 1-1.

/**
*  This test utility does simple (non-encrypted) HTTP
*/

#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <netdb.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>

#define HTTP_PORT        80
#define BUFFER_SIZE     255
#define MAX_GET_COMMAND 255

Listing 1.1: "http.c" header #includes and #defines