========================================================================
MICROSOFT FOUNDATION CLASS LIBRARY : SocketServer
========================================================================
AppWizard has created this SocketServer application for you. This application
not only demonstrates the basics of using the Microsoft Foundation classes
but is also a starting point for writing your application.
This file contains a summary of what you will find in each of the files that
make up your SocketServer application.
SocketServer.dsp
This file (the project file) contains information at the project level and
is used to build a single project or subproject. Other users can share the
project (.dsp) file, but they should export the makefiles locally.
SocketServer.h
This is the main header file for the application. It includes other
project specific headers (including Resource.h) and declares the
CSocketServerApp application class.
SocketServer.cpp
This is the main application source file that contains the application
class CSocketServerApp.
SocketServer.rc
This is a listing of all of the Microsoft Windows resources that the
program uses. It includes the icons, bitmaps, and cursors that are stored
in the RES subdirectory. This file can be directly edited in Microsoft
Visual C++.
SocketServer.clw
This file contains information used by ClassWizard to edit existing
classes or add new classes. ClassWizard also uses this file to store
information needed to create and edit message maps and dialog data
maps and to create prototype member functions.
res\SocketServer.ico
This is an icon file, which is used as the application's icon. This
icon is included by the main resource file SocketServer.rc.
res\SocketServer.rc2
This file contains resources that are not edited by Microsoft
Visual C++. You should place all resources not editable by
the resource editor in this file.
/////////////////////////////////////////////////////////////////////////////
AppWizard creates one dialog class:
SocketServerDlg.h, SocketServerDlg.cpp - the dialog
These files contain your CSocketServerDlg class. This class defines
the behavior of your application's main dialog. The dialog's
template is in SocketServer.rc, which can be edited in Microsoft
Visual C++.
/////////////////////////////////////////////////////////////////////////////
Other standard files:
StdAfx.h, StdAfx.cpp
These files are used to build a precompiled header (PCH) file
named SocketServer.pch and a precompiled types file named StdAfx.obj.
Resource.h
This is the standard header file, which defines new resource IDs.
Microsoft Visual C++ reads and updates this file.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" to indicate parts of the source code you
should add to or customize.
If your application uses MFC in a shared DLL, and your application is
in a language other than the operating system's current language, you
will need to copy the corresponding localized resources MFC42XXX.DLL
from the Microsoft Visual C++ CD-ROM onto the system or system32 directory,
and rename it to be MFCLOC.DLL. ("XXX" stands for the language abbreviation.
For example, MFC42DEU.DLL contains resources translated to German.) If you
don't do this, some of the UI elements of your application will remain in the
language of the operating system.
/////////////////////////////////////////////////////////////////////////////
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
环境:Windows XP SP3、 VC++ 6.0、 Windows 2003 SDK 使用步骤: 1、下载解压之后,使用VC++ 6.0打开两个工程:一个是SocketServer和一个ClientSocket工程。 2、首先运行服务器端工程,选默认的端口1008 3、然后运行客户端工程,选默认的端口1008和默认的服务器地址 4、再运行多个客户端进程 5、如果一切正常,可以每个客户端的消息发送,我们可以在服务端和各个客户端同步看到消息 实现一个服务器对多个客户端的关键是,在服务端的使用集合CPtrList类用保存客户端的socket对象,思想与Java中的编程思想一样,只不过Java中会使用多线程技术,在Vector集合保存客户端的socket对象,而MFC框架提供了CSocket类,它是一个异步通信的类,所以看上去代码比较Java的多线程代码简单的实现了一个对多的即时通讯功能。另外,MFC提供了CSocketFile类和CArchive类与CSocket类实现了C++的网络通讯编程功能。 本示例注释非常详细,所有的辅助类都放一个util目录中,然后在工程中分了一个目录来管理这些辅助类,使用代码非常清晰。手动书写部分的代码是按Java的规范书写,当然其它代码由IDE生成的,所以是MS的风格,所以当你看代码时,只要是使用“骆驮命名法”的方法都是本人书写的功能性代码。 参看的思路:在服务端要从回调方法onAccept读起;而客户端代码主要从OnSendButton方法读起,即可理解整个代码的意思。 阅读对象:具有Java的Socket编程经验的人员,并且希望能够书写出比Java效率更高的即时通讯程序的人员
资源推荐
资源详情
资源评论
收起资源包目录
MyProjects.rar (74个子文件)
SocketServer
MyPort.h 1KB
SocketServerDlg.h 2KB
Release
SocketServer.pch 5.49MB
StdAfx.obj 810B
SocketServer.res 3KB
Message.obj 7KB
SocketServer.exe 28KB
MyPort.obj 11KB
SocketServerDlg.obj 33KB
socketclient.obj 9KB
vc60.idb 57KB
SocketServer.obj 10KB
socketlistener.obj 6KB
SocketServer.aps 36KB
res
SocketServer.rc2 404B
SocketServer.ico 1KB
SocketServer.dsw 549B
SocketServer.dsp 5KB
SocketServer.opt 61KB
SocketServerDlg.cpp 10KB
StdAfx.cpp 214B
SocketServer.cpp 2KB
resource.h 1KB
SocketServer.ncb 81KB
SocketServer.rc 6KB
StdAfx.h 1KB
MyPort.cpp 1KB
SocketServer.clw 2KB
util
socketlistener.h 2KB
Message.cpp 1KB
socketclient.h 2KB
socketlistener.cpp 1KB
socketclient.cpp 3KB
Message.h 1KB
SocketServer.plg 2KB
SocketServer.h 1KB
ReadMe.txt 4KB
ClientSocket
ClientSocketDlg.h 2KB
ClientSocket.dsp 5KB
res
ClientSocket.rc2 404B
ClientSocket.ico 1KB
ClientSocket.opt 49KB
ClientSocket.dsw 549B
ClientSocket.h 1KB
ClientSocket.plg 1KB
ClientSocket.rc 6KB
ClientSocket.aps 36KB
StdAfx.cpp 214B
resource.h 1KB
ClientSocket.ncb 73KB
StdAfx.h 1KB
util
Message.cpp 1KB
ChatSocket.cpp 1KB
Message.h 1KB
chatsocket.h 1KB
Debug
ClientSocket.ilk 284KB
ClientSocket.pch 5.31MB
StdAfx.obj 104KB
ClientSocket.exe 116KB
Message.obj 11KB
ChatSocket.obj 7KB
ClientSocket.obj 15KB
ClientSocket.pdb 441KB
vc60.idb 225KB
SetupDlg.obj 15KB
vc60.pdb 364KB
ClientSocketDlg.obj 50KB
ClientSocket.res 3KB
ClientSocket.clw 2KB
ClientSocketDlg.cpp 9KB
SetupDlg.h 1KB
ReadMe.txt 4KB
SetupDlg.cpp 1KB
ClientSocket.cpp 2KB
共 74 条
- 1
小霞xiaoxia
- 粉丝: 22
- 资源: 143
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
- 6
前往页