今天的事太多,没有认真的完成任务,不过把服务器端的文件传输做好了!
明天把服务器端的代码集成起来测试一下,并把网络客户端程序做好!
把代码贴出来吧!便于保存!
头文件:server_udpsocket.h
#ifndef _SERVER_UDPSOCKET_H_
#define _SERVER_UDPSOCKET_H_
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <pthread.h>
#include <sys/wait.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#define bool int
#define true 1
#define false 0
int errno ;
bool init_udpsocket() ;
bool udpsocket_Run() ;
void *thread_udpsocket() ;
#endif
程序文件:server_udpsocket.c
#include "server_udpsocket.h"
int hsockfd; // Socket file descrip