nim_duilib/examples/proto_debuger/tcp_server_form.h

48 lines
1.0 KiB
C
Raw Normal View History

2021-12-30 17:27:33 +08:00
#pragma once
// base header
#include "base/base.h"
#include "serial_port.h"
// duilib
#include "duilib/UIlib.h"
#include "tcp_server_libevent.h"
2022-01-11 01:07:59 +08:00
#include <map>
#include "lua_wraper.h"
2021-12-30 17:27:33 +08:00
class TcpServerFrom :
public ui::ChildBox
{
public:
TcpServerFrom(ui::Window* hwnd, string url, uint32_t port, TcpServerLibevent* p);
TcpServerLibevent* ServerP();
virtual void Init() override;
2022-01-08 00:23:09 +08:00
void OnNewConnAccept(ConnectionLibevent*);
2022-01-06 00:31:24 +08:00
void OnDisConnected(ConnectionLibevent*);
protected:
2021-12-30 17:27:33 +08:00
private:
2022-01-08 00:23:09 +08:00
void updateStatus();
2021-12-30 17:27:33 +08:00
TcpServerLibevent* m_server;
2021-12-31 01:12:11 +08:00
std::string m_url;
uint32_t m_port;
2021-12-30 17:27:33 +08:00
ui::Label* m_label_1;
ui::RichEdit* m_rich_edit_1;
ui::RichEdit* m_rich_edit_2;
ui::RichEdit* m_rich_edit_3;
ui::Button* m_button_1;
ui::CheckBox* m_check_box_1;
ui::CheckBox* m_check_box_2;
ui::RichEdit* m_rich_edit_4;
ui::CheckBox* m_check_box_3;
ui::CheckBox* m_check_box_4;
ui::Button* m_button_2;
ui::Label* m_label_2;
ui::Combo* m_combo_1;
ui::Button* m_button_3;
2022-01-11 01:07:59 +08:00
std::map<uint32_t, ConnectionLibevent*> mClients;
bool mFlagSelectClient;
LuaDelegate *mLua;
2021-12-30 17:27:33 +08:00
};