123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- // ServerDlg.h : header file
- //
- #pragma once
- #include "afxwin.h"
- #include "../../../Src/SSLServer.h"
- #include "../../Global/helper.h"
- // CServerDlg dialog
- class CServerDlg : public CDialogEx, public CTcpServerListener
- {
- // Construction
- public:
- CServerDlg(CWnd* pParent = NULL); // standard constructor
- // Dialog Data
- enum { IDD = IDD_SERVER_DIALOG };
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- virtual BOOL PreTranslateMessage(MSG* pMsg);
- // Implementation
- protected:
- HICON m_hIcon;
- // Generated message map functions
- virtual BOOL OnInitDialog();
- afx_msg void OnPaint();
- afx_msg HCURSOR OnQueryDragIcon();
- afx_msg void OnBnClickedStart();
- afx_msg void OnBnClickedStop();
- afx_msg void OnBnClickedDisconnect();
- afx_msg void OnEnChangeConnId();
- afx_msg LRESULT CServerDlg::OnUserInfoMsg(WPARAM wp, LPARAM lp);
- afx_msg int OnVKeyToItem(UINT nKey, CListBox* pListBox, UINT nIndex);
- DECLARE_MESSAGE_MAP()
- public:
- void SetAppState(EnAppState state);
- private:
- virtual EnHandleResult OnPrepareListen(SOCKET soListen);
- virtual EnHandleResult OnAccept(CONNID dwConnID, SOCKET soClient);
- virtual EnHandleResult OnHandShake(CONNID dwConnID);
- virtual EnHandleResult OnSend(CONNID dwConnID, const BYTE* pData, int iLength);
- virtual EnHandleResult OnReceive(CONNID dwConnID, const BYTE* pData, int iLength);
- virtual EnHandleResult OnClose(CONNID dwConnID, EnSocketOperation enOperation, int iErrorCode);
- virtual EnHandleResult OnShutdown();
- private:
- CListBox m_Info;
- CButton m_Start;
- CButton m_Stop;
- CEdit m_Address;
- CEdit m_ConnID;
- CButton m_DisConn;
- EnAppState m_enState;
- private:
- static const USHORT PORT;
- static const LPCTSTR ADDRESS;
- CString m_strAddress;
- CSSLServer m_Server;
- };
|