资源简介
TCP_Socket.zip
代码片段和文件信息
/***************************************************************************************
****************************************************************************************
class cSocket
Description:
A universal asynchronous bidirectional TCP Winsock Socket class for client and server.
The server supports up to 62 connections at the same time.
This class may run within one single thread.
All functions in this class return an API error code or 0 on success.
Author:
Elm?(www.netcult.ch/elmue)
****************************************************************************************
****************************************************************************************/
#include “stdafx.h“
#include “Socket.h“
/*
----------------------------------------------------------------------------------
Using these conventions results in better readable code and less coding errors !
----------------------------------------------------------------------------------
cName for generic class definitions
CName for MFC class definitions
tName for type definitions
eName for enum definitions
kName for struct definitions
e_Name for enum variables
E_Name for enum constant values
i_Name for instances of classes
h_Name for handles
M_Name for macros
T_Name for Templates
t_Name for TCHAR or LPTSTR
s_Name for strings
sa_Name for Ascii strings
sw_Name for Wide (Unicode) strings
bs_Name for BSTR
f_Name for function pointers
k_Name for contructs (struct)
b_Name boolBOOL 1 Bit
s8_Name signed 8 Bit (char)
s16_Name signed 16 Bit (SHORT)
s32_Name signed 32 Bit (LONG int)
s64_Name signed 64 Bit (LONGLONG)
u8_Name unsigned 8 Bit (BYTE)
u16_Name unsigned 16 bit (WORD WCHAR)
u32_Name unsigned 32 Bit (DWORD UINT)
u64_Name unsigned 64 Bit (ULONGLONG)
d_Name for double
----------------
m_Name for member variables of a class (e.g. ms32_Name for int member variable)
g_Name for global (static) variables (e.g. gu16_Name for global WORD)
p_Name for pointer (e.g. ps_Name *pointer to string)
pp_Name for pointer to pointer (e.g. ppd_Name **pointer to double)
*/
TCP::cSocket::cSocket()
{
mb_Initialized = FALSE;
mu32_WaitIndex = 0;
ms8_ReadBuffer = 0;
mu32_Tick64Lo = 0;
mu32_Tick64Hi = 0;
ms64_MaxIdleTime = 0;
mu32_EventTimeout = 0;
}
TCP::cSocket::~cSocket()
{
if (mb_Initialized)
{
Close();
WSACleanup();
}
if (ms8_ReadBuffer) delete ms8_ReadBuffer;
}
// protected
// Load ws2_32.dll and initialize Windsock 2.0
DWORD TCP::cSocket::Initialize()
{
if (mb_Initialized)
return 0;
// Winsock version 2.0 is available on ALL Windows operating systems
// except Windows 95 which comes with Winsock 1.1
WSADATA k_Data;
DWOR
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2009-07-27 19:08 TCP Socket 1.5\
目录 0 2009-07-27 19:08 TCP Socket 1.5\Release\
文件 40960 2009-08-26 00:37 TCP Socket 1.5\Release\SocketDemo.exe
文件 85374 2009-08-26 00:39 TCP Socket 1.5\Documentation.chm
文件 1101 2009-07-31 14:29 TCP Socket 1.5\resource.h
文件 42819 2009-09-15 20:09 TCP Socket 1.5\Socket.cpp
文件 6160 2009-09-15 20:08 TCP Socket 1.5\Socket.h
文件 2291 2009-07-31 14:29 TCP Socket 1.5\SocketDemo.clw
文件 1484 2009-03-05 11:08 TCP Socket 1.5\SocketDemo.cpp
文件 1226 2009-03-05 11:08 TCP Socket 1.5\SocketDemo.h
文件 5815 2009-07-31 14:29 TCP Socket 1.5\SocketDemo.rc
文件 27810 2009-08-16 18:27 TCP Socket 1.5\SocketDemoDlg.cpp
文件 3799 2009-08-26 00:34 TCP Socket 1.5\SocketDemoDlg.h
文件 4162 2009-08-14 20:10 TCP Socket 1.5\SocketDemo_MBCS.dsp
文件 548 2009-03-05 11:08 TCP Socket 1.5\SocketDemo_MBCS.dsw
文件 4226 2009-08-09 12:26 TCP Socket 1.5\SocketDemo_UNICODE.dsp
文件 551 2009-03-05 11:08 TCP Socket 1.5\SocketDemo_UNICODE.dsw
文件 212 2009-03-05 11:08 TCP Socket 1.5\StdAfx.cpp
文件 999 2009-02-09 20:02 TCP Socket 1.5\StdAfx.h
文件 503682 2000-10-25 11:20 TCP Socket 1.5\WinSock FAQ.chm
文件 576 2009-03-06 13:41 TCP Socket 1.5\_CleanDirectory.cmd
- 上一篇:极化码的编码构造
- 下一篇:OpenGL实现多边形扫描转换的扫描线算法-带动画效果
相关资源
- PID_AutoTune_v0.rar
- vspd7.2.308.zip
- 价值2k的H漫画小说系统
- Pythonamp;课堂amp;笔记(高淇amp;400;集第
- ddos压力测试工具99657
- UML建模大全
- 开源1A锂电池充电板TP4056原理图+PCB
- m1卡 ic卡可选择扇区初始化加密软件
- TSCC.exe
- FTP课程设计(服务端+客户端)
- 计算机图形学 边填充算法实现代码
- 电力系统潮流计算程序集合
- oracle数据迁移项目实施方案
- Web Api 通过文件流 文件到本地
- Visio图标-最新最全的网络通信图标库
- Spire API文档
- OpenGL参考手册
- Python中Numpy库最新教程
- SPD博士V5.3.exe
- 直流无刷电机方波驱动 stm32 例程代码
- layui后台管理模板
- 仿知乎界面小程序源代码
- 云平台-阿里云详细介绍
- photoshop经典1000例
- scratch垃圾分类源码(最终版本).sb
- IAR ARM 7.8破解
- TI CCS V5.4 安装步骤及破解文件
- 松下plc FP-XH的驱动
- 局域网硬件信息收集工具
- 加快Windows XP操作系统开机速度
评论
共有 条评论