資源簡介
一個完整的socket編程例子,有服務(wù)器,客戶端,可以監(jiān)聽任意端口,遍歷本機(jī)所有可用ip。 入門,簡單實用還是很不錯的,可以直接用,已經(jīng)測試過了。
代碼片段和文件信息
/***************************************************************************************
****************************************************************************************
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?!
-----------------------------------------------------------------------
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????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
評論
共有 條評論