资源简介
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实现多边形扫描转换的扫描线算法-带动画效果
相关资源
- QQctangyunxiangc.rar
- 东华-表结构资料.zip
- 敏感词词库.txt
- sunnyman2008_10945697.ap14
- Alamouti.zip
- sRGBColorCheckerBoundary.jpg
- 深入性能测试:LoadRunner性能测试、流
- Zookeeper学习.txt
- s.exe
- 编译好的opencv_conrib库.txt
- dr.com5.2.zip
- 新建文本文档.rar
- z6x36z.doc
- tech_video.zip
- 基于UDP的局域网聊天系统.doc
- office密码破解工具OPRTbox绿色注册版
- dhe0ug.rar
- 88npkv.doc
- 前端跳槽面试必备技巧.docx
- license_quartus8.1.rar
- B-Human添加module与representation.pdf
- B-Human校准命令.pdf
- B-Human命令总结.pdf
- permutationentropy.rar
- 百度云盘.txt
- VoiceRecorder.rar
- ws.zip
- 4360GoogleAVA数据集百度云地址及相关介
- arithmetic.rar
- 省市区商圈数据库.rar
评论
共有 条评论