dl
首页
相关页面
命名空间
类
文件
文件列表
文件成员
dl
io
dl_net.h
浏览该文件的文档.
1
12
#pragma once
13
14
#include <asio.hpp>
15
16
#include "
io/dl_log.h
"
17
18
namespace
dl
19
{
20
class
Network
21
{
22
public
:
23
Network
()
24
{
25
Debug
();
26
}
30
static
std::string
GetHostName
()
31
{
32
return
asio::ip::host_name();
33
}
37
//static std::string GetIpAddress()
38
//{
39
// asio::io_context io;
40
// asio::ip::udp::resolver r{ io };
41
// asio::query q{ udp::v4(), "google.com", "" };
42
43
//}
44
45
void
Debug
()
46
{
47
log_msg
(
"----------------网络信息-------------\n"
48
"主机名:\n{}"
49
""
,
50
GetHostName
());
51
}
52
};
53
54
extern
Network*
g_net
;
55
}
dl::Network
Definition:
dl_net.h:21
dl::Network::Debug
void Debug()
返回本机ip
Definition:
dl_net.h:45
dl::Network::Network
Network()
Definition:
dl_net.h:23
dl::Network::GetHostName
static std::string GetHostName()
返回主机名
Definition:
dl_net.h:30
dl_log.h
日志系统
log_msg
#define log_msg(...)
Definition:
dl_log.h:193
dl
Definition:
dl_array2.h:18
dl::g_net
Network * g_net
制作者
1.9.5