You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
1.7 KiB
C++
65 lines
1.7 KiB
C++
// VisionNW.h: interface for the CVisionNW class.
|
|
//
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
#if !defined(AFX_VISION_H__2BD08341_32C8_11D7_A913_00902775C68D__INCLUDED_)
|
|
#define AFX_VISION_H__2BD08341_32C8_11D7_A913_00902775C68D__INCLUDED_
|
|
|
|
#if _MSC_VER > 1000
|
|
#pragma once
|
|
#endif // _MSC_VER > 1000
|
|
|
|
#include "MySocket.h"
|
|
|
|
#ifdef _DLLCLASS
|
|
#undef _DLLCLASS
|
|
#endif
|
|
|
|
#define _DLLCLASS __declspec(dllexport)
|
|
|
|
#define MAXSOCKBUF 4096
|
|
#define SERVER TRUE
|
|
#define CLIENT FALSE
|
|
|
|
class _DLLCLASS CVisionNW
|
|
{
|
|
public:
|
|
void ResetReceiveBuffer();
|
|
CVisionNW();
|
|
virtual ~CVisionNW();
|
|
|
|
void OnClose(int nErrorCode);
|
|
void OnReceive(int nErrorCode);
|
|
void OnSend(int nErrorCode);
|
|
void OnConnect(int nErrorCode);
|
|
void OnAccept(int nErrorCode);
|
|
|
|
bool m_bTraceData;
|
|
|
|
protected:
|
|
BOOL Send(CString csMsg);
|
|
BOOL IsConnectedToServer(void);
|
|
BOOL IsServerActive(void);
|
|
BOOL IsClientConnected(void);
|
|
void Disconnect(void);
|
|
BOOL Connect(int nPort, CString csServerName, BOOL bServer = TRUE);
|
|
virtual void ReceiveComm(const char *cpcBuffer, int nSize);
|
|
void ProcessMessage(void);
|
|
|
|
char m_RcvBuff[MAXSOCKBUF];
|
|
bool m_bDataComplete;
|
|
int m_nBufferPtr;
|
|
|
|
private:
|
|
CString m_csServerName;
|
|
BOOL m_bServerActive;
|
|
BOOL m_bConnectedToServer;
|
|
BOOL m_bClientConnected;
|
|
|
|
CMySocket m_sListenSocket;
|
|
CMySocket m_sConnectSocket;
|
|
BOOL m_bConnectionType;
|
|
int m_nPort;
|
|
};
|
|
#endif // !defined(AFX_VISION_H__2BD08341_32C8_11D7_A913_00902775C68D__INCLUDED_)
|