-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlmFileServer.h
More file actions
52 lines (41 loc) · 881 Bytes
/
lmFileServer.h
File metadata and controls
52 lines (41 loc) · 881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* lmFileServer.h
*
* Created on: 2016年7月12日
* Author: limin
*/
#ifndef LMFILESERVER_H_
#define LMFILESERVER_H_
#include <sys/types.h>
#include <sys/wait.h>
#include <cerrno>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
#include <iostream>
#include <fstream> // file stream operation
#include <iomanip> // Custom the output and input
#include <iostream>
using namespace std;
class lm_File_Server {
// Constructor and Destructor
public:
lm_File_Server();
lm_File_Server(int port);
virtual ~lm_File_Server();
// Attributions
//int serverip;
int serverport;
int server_fd; // the socket fd of the server
// Functions
private:
int ServerInit(int port);
public:
int RecvFile(char* filename);
};
#endif /* LMFILESERVER_H_ */