TcpTran.h
资源名称:Visualhk.rar [点击查看]
上传用户:cjw5120
上传日期:2022-05-11
资源大小:5032k
文件大小:1k
源码类别:
网络截获/分析
开发平台:
Visual C++
- // TcpTran.h: interface for the CTcpTran class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_TCPTRAN_H__F3515A70_E030_420C_986B_174D6C0E9E06__INCLUDED_)
- #define AFX_TCPTRAN_H__F3515A70_E030_420C_986B_174D6C0E9E06__INCLUDED_
- /*
- 作者:海啸 lyyer English Name: Jack
- blog:http://lyyer.blog.sohu.com
- website:http://www.cnGSG.com
- 海啸网络安全组织
- */
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #define SOCKETBIND 1
- #define SOCKETNOBIND 2
- #define SOCKET_TIMEOUT -100
- #include "winsock2.h"
- #include <string>
- using namespace std;
- #pragma comment (lib,"ws2_32.lib")
- class CTcpTran
- {
- public:
- CTcpTran();
- virtual ~CTcpTran();
- public:
- static BOOL InitSocketLibray(int lowver,int higver );
- public:
- SOCKET InitSocket( int SocketType, string strBindIp,u_short BindPort,int opt);
- SOCKET myaccept(SOCKET s,struct sockaddr* addr,int* addrlen);
- int mysend(SOCKET sock, const char *buf, int len, int flag,int overtime);
- int myrecv(SOCKET sock, char *buf, int len, int flag , int overtime,char*EndMark,BOOL soonflag=FALSE);
- public:
- SOCKET m_Socket;
- };
- #endif // !defined(AFX_TCPTRAN_H__F3515A70_E030_420C_986B_174D6C0E9E06__INCLUDED_)