📄 mysocket.cpp
字号:
// mysocket.cpp: implementation of the mysocket class.
//
//////////////////////////////////////////////////////////////////////
#include<afxwin.h>
#include<afxsock.h>
#include "mysocket.h"
#include "Serdlg.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
mysocket::mysocket()
{
name="";
}
mysocket::~mysocket()
{
}
void mysocket::setparent(CDialog *dialog)
{
dlg=dialog;
}
//
// This function will be called when the client connects to
// the Server.
//
void mysocket::OnAccept(int errcode)
{
if(errcode==0)
((Serdlg*)dlg)->Accept();
CSocket::OnAccept(errcode);
}
//
// This function is gets invoked when the socket recieves the
// data from the remote socket
//
void mysocket::OnReceive(int errcode)
{
if(errcode==0)
((Serdlg*)dlg)->Receive(this);
CSocket::OnAccept(errcode);
}
void mysocket::OnClose(int errcode)
{
if(errcode==0)
((Serdlg*)dlg)->OnCloseClient(this);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -