📄 recsocket.cpp
字号:
// RecSocket.cpp : implementation file
//
#include "stdafx.h"
#include "RecSocket.h"
#include "head.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CRecSocket
CRecSocket::CRecSocket(CWaveOut *pTemp)
{
m_bIni = FALSE;
g_pOut = pTemp;
m_pFrame = (struct Frame *)m_cBuffer;
}
CRecSocket::~CRecSocket()
{
}
// Do not edit the following lines, which are needed by ClassWizard.
#if 0
BEGIN_MESSAGE_MAP(CRecSocket, CSocket)
//{{AFX_MSG_MAP(CRecSocket)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
#endif // 0
/////////////////////////////////////////////////////////////////////////////
// CRecSocket member functions
BOOL CRecSocket::Ini(UINT nPort)
{
if (m_bIni)
return FALSE;
if (!Create (nPort/*TALK_REC_PORT*/,SOCK_DGRAM))
return FALSE;
m_bIni = TRUE;
return TRUE;
}
void CRecSocket::OnReceive(int nErrorCode)
{
// TODO: Add your specialized code here and/or call the base class
m_iLen = sizeof(m_cBuffer);
m_iLen = this->Receive (m_pFrame,m_iLen);
m_sort.ReceiveData (g_pOut,(char *)m_pFrame,m_iLen);
CSocket::OnReceive(nErrorCode);
}
BOOL CRecSocket::CloseSocket()
{
if (!m_bIni)
return FALSE;
m_bIni = FALSE;
CSocket::Close ();
return TRUE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -