|
1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #ifndef _FILEOPERATION_H_ //ֹظ
- #define _FILEOPERATION_H_
- #include"tcpSocket.h"
-
- //
- enum MSGTAG
- {
- MSG_FILENAME = 1, //ļ
- MSG_FILESIZE = 2, //ļС
- MSG_READY_READ = 3, //
- MSG_SEND = 4, //
- MSG_SUCCESSED = 5, //
-
- MSG_OPENFILE_FAILD = 6 //߿ͻļҲ
-
- };
-
- struct MsgHeader //װϢͷṹ
- {
- enum MSGTAG msgID; //ǰϢ
- struct
- {
- int fileSize; //ļС
- char fileName[256]; //ļ
- }fileInfo;
- };
-
- /******/
- //ȡļ
- bool readFile(struct MsgHeader* pmsg);
- //ļ
- bool sendFile(SOCKET s, struct MsgHeader* pmsg);
- /***ͻ***/
- //ļ
- void downloadFileName(SOCKET serfd);
- //ļ
- bool recvFile(SOCKET s);
- //ļ
- bool saveFile(struct MsgHeader* pmsg);
-
- #endif //!__FILEOP_H_
|