19#define DL_NETWORK_DEBUG_INFO
56 return &
_list.front();
93 std::atomic_bool _bEnd;
96 static void _thread_run(
void*);
114 static void _thread_run(
void*);
122 void SetAddress(std::string_view ip, uint16_t port,
bool broadcast =
false);
131 std::atomic_bool _bEnd;
137 static void _thread_send(
void*);
138 static void _thread_recv(
void*);
147 void Start(std::string_view ip, uint16_t port);
159 static void _thread_run(
void*);
184 return vec.empty() ?
"127.0.0.1" : vec[0];
189 log_msg(
"----------------网络信息-------------\n"
197extern Network*
g_net;
void Send(BufferView buf)
void Send(BufferView buf)
void SetAddress(std::string_view ip, uint16_t port, bool broadcast=false)
static std::string GetIpAddressLocalFirst(bool ipv4=true)
返回第一个本地ip,失败返回127.0.0.1
static std::vector< std::string > GetIpAddressLocal(bool ipv4=true)
返回本地ip
static std::string GetHostName()
返回主机名
friend class ServerUdpImp
void Start(std::string_view ip, uint16_t port)
constexpr uint32_t NETWORK_MESSAGE_TAG
std::span< std::byte > BufferView
ListMultiThread< UdpMessage > UdpMessageList
std::vector< std::byte > Buffer
ListMultiThread< Buffer > BufferList
std::list< Buffer > _listTemp
std::list< Buffer > _list