sendframesocket.cpp

来自「Screen Chatting source」· C++ 代码 · 共 59 行

CPP
59
字号
// SendFrameSocket.cpp : implementation file
//

#include "stdafx.h"
#include "ScreenChattingClient.h"
#include "SendFrameSocket.h"

#include "ScreenChattingClientDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CSendFrameSocket

CSendFrameSocket::CSendFrameSocket()
{
}

CSendFrameSocket::CSendFrameSocket(CScreenChattingClientDlg *pScreenChattingClientDlg)
{
	m_pScreenChattingClientDlg=pScreenChattingClientDlg;
}
CSendFrameSocket::~CSendFrameSocket()
{
}


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

/////////////////////////////////////////////////////////////////////////////
// CSendFrameSocket member functions

void CSendFrameSocket::OnReceive(int nErrorCode) 
{
	// TODO: Add your specialized code here and/or call the base class
	int nBufferSize;

	Receive(&nBufferSize,sizeof(int));

	BYTE *pJpegData=(BYTE *)malloc(nBufferSize);
	Receive(pJpegData,nBufferSize);

	m_pScreenChattingClientDlg->ReceiveJpegData(pJpegData,nBufferSize);

	free(pJpegData);

	CAsyncSocket::OnReceive(nErrorCode);
}

⌨️ 快捷键说明

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