Creato server-client daytime e print_ip_client

This commit is contained in:
2014-04-11 02:13:31 +02:00
parent ffda44b101
commit 7e0049f2ef
38 changed files with 645 additions and 13 deletions

28
basic.h Normal file
View File

@@ -0,0 +1,28 @@
#ifndef __BASIC__
#define __BASIC__
#include <sys/types.h> /* basic system data types */
#include <sys/socket.h> /* basic socket definitions */
#include <sys/time.h> /* timeval{} for select() */
#include <time.h> /* timespec{} for pselect() */
#include <netinet/in.h> /* sockaddr_in{} and other Internet defns */
#include <arpa/inet.h> /* inet(3) functions */
#include <errno.h>
#include <fcntl.h> /* for nonblocking */
#include <netdb.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h> /* for S_xxx file mode constants */
#include <sys/uio.h> /* for iovec{} and readv/writev */
#include <unistd.h>
#include <sys/wait.h>
#include <sys/un.h> /* for Unix domain sockets */
#define MAXLINE 256
#define PORT 12345
#define BACKLOG 5
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#endif