REMOVE DLLCHR.Add TCP/IP COMM.
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
// protocol for control SevenOcean's Machine
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
#ifndef SO7_TCPIP_H_INCLUDED_
|
||||
#define SO7_TCPIP_H_INCLUDED_
|
||||
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include <afxwin.h>
|
||||
#include <afxcmn.h>
|
||||
#include <Winsock2.h>
|
||||
#define WM_SOCKET WM_USER + 0x1
|
||||
|
||||
typedef enum {
|
||||
TCPIP_CONNECT_OK=0,
|
||||
|
||||
TCPIP_INIT_WINSOCK_ERROR,
|
||||
TCPIP_INVAILD_SOCKET,
|
||||
TCPIP_INVAILD_IP_ADDRESS,
|
||||
TCPIP_INVAILD_PORT_NUMBER,
|
||||
TCPIP_CONNECT_SERVER_FAILED,
|
||||
} TCPIP_RETURN_CODE;
|
||||
|
||||
//======================================================================================
|
||||
class CSo7_TCPIP
|
||||
{
|
||||
public:
|
||||
CSo7_TCPIP();
|
||||
virtual ~CSo7_TCPIP();
|
||||
|
||||
TCPIP_RETURN_CODE Connect();
|
||||
TCPIP_RETURN_CODE Send();
|
||||
TCPIP_RETURN_CODE Recv();
|
||||
TCPIP_RETURN_CODE DisConnect();
|
||||
HWND m_hMsgWnd;
|
||||
LRESULT OnSocket(WPARAM wParam, LPARAM lParam);
|
||||
private:
|
||||
SOCKET m_socket;
|
||||
LPCSTR m_pszNetworkAddr;
|
||||
u_short m_nPortNumber;
|
||||
bool m_bDisableTimeout;
|
||||
int Init_Winsock();
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user