clientstreamsock.cpp

来自「一个VC实现的,用G.729a实现的语言对讲的例子」· C++ 代码 · 共 64 行

CPP
64
字号
// ClientStreamSock.cpp : implementation file
//

#include "stdafx.h"
#include "RemoteTalk.h"
#include "ClientStreamSock.h"
#include "RemoteTalkDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CClientStreamSock

CClientStreamSock::CClientStreamSock()
{
}

CClientStreamSock::~CClientStreamSock()
{
}


// Do not edit the following lines, which are needed by ClassWizard.
#if 0
BEGIN_MESSAGE_MAP(CClientStreamSock, CAsyncSocket)
	//{{AFX_MSG_MAP(CClientStreamSock)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()
#endif	// 0

/////////////////////////////////////////////////////////////////////////////
// CClientStreamSock member functions

void CClientStreamSock::OnConnect(int nErrorCode) 
{
	CRemoteTalkDlg* pDlg=(CRemoteTalkDlg*)::AfxGetMainWnd();
	if (nErrorCode==0)
	{
		pDlg->m_ClientCtrlSock.Connect(pDlg->m_strIPAddr,1500);
	}
	else
	{
		AfxMessageBox("can't connect to server!");
	}


	// TODO: Add your specialized code here and/or call the base class
	
	CAsyncSocket::OnConnect(nErrorCode);
}

void CClientStreamSock::OnReceive(int nErrorCode) 
{
	CRemoteTalkDlg* pDlg=(CRemoteTalkDlg*)::AfxGetMainWnd();

	// TODO: Add your specialized code here and/or call the base class
	
	CAsyncSocket::OnReceive(nErrorCode);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?