2015-11-06 06:57:03 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <signal.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <getopt.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <netinet/in.h>
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
#include <iostream>
|
|
|
|
#include <vector>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
|
|
|
typedef struct client_s
|
|
|
|
{
|
|
|
|
struct sockaddr_in addr;
|
|
|
|
int socket;
|
|
|
|
pid_t pid;
|
|
|
|
int pipefd[2];
|
|
|
|
} client_t;
|
|
|
|
|
|
|
|
|
2015-11-04 20:31:47 +08:00
|
|
|
void client();
|
2015-11-06 06:57:03 +08:00
|
|
|
void error_exit(const char* why);
|
|
|
|
void print_client(client_t* client, const char* what);
|