Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
ChatSock.cpp
Package: anywhere.zip [view]
Upload User: zhenhuadz
Upload Date: 2007-01-07
Package Size: 1511k
Code Size: 1k
Category:
Remote Control
Development Platform:
Visual C++
- // ChatSock.cpp : implementation file
- //
- #include "stdafx.h"
- #include "AnyServer.h"
- #include "ChatSock.h"
- #include "AnyServerDoc.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CChatSock
- CChatSock::CChatSock()
- {
- }
- CChatSock::~CChatSock()
- {
- if (m_pArchiveOut != NULL)
- delete m_pArchiveOut;
- if (m_pArchiveIn != NULL)
- delete m_pArchiveIn;
- if (m_pFile != NULL)
- delete m_pFile;
- }
- // Do not edit the following lines, which are needed by ClassWizard.
- #if 0
- BEGIN_MESSAGE_MAP(CChatSock, CSocket)
- //{{AFX_MSG_MAP(CChatSock)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- #endif // 0
- /////////////////////////////////////////////////////////////////////////////
- // CChatSock member functions
- CChatSock::CChatSock(CAnyServerDoc* pDoc)
- {
- m_pDoc=pDoc;
- }
- void CChatSock::OnReceive(int nErrorCode)
- {
- CSocket::OnReceive(nErrorCode);
- m_pDoc->ProcessPendingRead(this);
- }
- void CChatSock::init()
- {
- m_pFile = new CSocketFile(this);
- m_pArchiveIn = new CArchive(m_pFile,CArchive::load);
- m_pArchiveOut = new CArchive(m_pFile,CArchive::store);
- }