⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 receivefile.h

📁 本代码是基于LINUX系统下的
💻 H
字号:
// ReceiveFile.h: interface for the CReceiveFile class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_RECEIVEFILE_H__C07CADDE_E443_4513_8CF2_0BF931DEAC39__INCLUDED_)
#define AFX_RECEIVEFILE_H__C07CADDE_E443_4513_8CF2_0BF931DEAC39__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <winsock.h>
//#include <iostream.h>
#include <stdio.h>
//#include <fstream.h>
#include <string.h>

#define		TRAN_SUCCESS		1	//传输成功
#define		SOCK_WSA_ERR		(-1)	//启动winsock失败
#define		SOCK_CRSOCK_ERR		(-2)	//创建套接字失败
#define		SOCK_BIND_ERR		(-3)	//绑定端口失败
#define		SOCK_LISTEN_ERR		(-4)	//监听失败
#define		SOCK_ACCEPT_ERR		(-5)	//等待连接失败
#define		SOCK_SEND_ERR		(-6)	//发送数据失败
#define		SOCK_CLOSE_ERR		(-7)	//关闭	SOCKET失败
#define		SOCK_RECVE_ERR		(-8)	//接受数据失败
#define		SOCK_CONNECT_ERR	(-10)
#define		FILE_ERR		(-9)	//文件错误
#define 	Other_ERR		(0)	//其他不明原因

#define SVR_PORT		8439		//服务器端口
#define SEND_BUFFER_SIZE	4096		//每次发送大小
#define RECV_BUFFER_SIZE	4096		//每次发送大小

struct Fileinfo
{    
    char		 fileName[50];	//文件名
    int 		 fileBlock;	//文件分块大小
    int 		 BlockNum;	//文件块数量
    unsigned long   	 fileSize;	//文件总大小
};
class CReceiveFile  
{
public:
	CReceiveFile();
	virtual ~CReceiveFile();

	int RecevData( SOCKET  s ,CString filemsg);
	int Client( CString strIP  ,CString filemsg);
	void PrintReturn(int nRet);

};

#endif // !defined(AFX_RECEIVEFILE_H__C07CADDE_E443_4513_8CF2_0BF931DEAC39__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -