common_h

来源:互联网 发布:c语言~什么意思 编辑:程序博客网 时间:2024/05/16 06:31

#ifndef __NETWORK__H__
#define __NETWORK__H__
 #include <unistd.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <errno.h>
 #include <error.h>
 #include <string.h>
 #include <signal.h>
 #include <fcntl.h>
 #include <sys/ipc.h>
 #include <sys/shm.h>
 #include <sys/sem.h>
 
 #include <pthread.h>
 #include <semaphore.h>
 #include <signal.h>
 
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <arpa/inet.h>
 #include <netinet/in.h>
 #include <netdb.h>
 #include <sys/select.h>
 #include <sys/time.h>


 #pragma once
 #pragma pack(4)
 #define BUFFER_SIZE 1024
 
 #define Server_port 8888
 #define BACKLOG 5
 #define ADDR_SIZE sizeof(struct sockaddr_in)
 
 #define RUNNING 1

 
 #define Err_sys(info)                                    \
 {                                                               \
  fprintf(stderr,"%s:%s\n",info,strerror(errno));   \
  exit(EXIT_FAILURE);                               \
 }


 

#endif

原创粉丝点击