|
@@ -1,12 +1,12 @@
|
|
|
/**
|
|
|
- ******************************************************************************
|
|
|
- * @file : main_udp.cpp
|
|
|
- * @author : wangyingjie
|
|
|
- * @brief : None
|
|
|
- * @attention : None
|
|
|
- * @date : 2025/7/2
|
|
|
- ******************************************************************************
|
|
|
- */
|
|
|
+ ******************************************************************************
|
|
|
+ * @file : main_udp.cpp
|
|
|
+ * @author : wangyingjie
|
|
|
+ * @brief : None
|
|
|
+ * @attention : None
|
|
|
+ * @date : 2025/7/2
|
|
|
+ ******************************************************************************
|
|
|
+ */
|
|
|
|
|
|
#include "network/socket/studio_udp.h"
|
|
|
#include "controlcan.h"
|
|
@@ -96,7 +96,7 @@ void on_message_received_client(const std::string& msg, const udp::endpoint& ep)
|
|
|
int main()
|
|
|
{
|
|
|
// 创建客户端,默认缓冲区大小 (4KB)
|
|
|
- studio_udp client("0.0.0.0",8089,"192.168.3.20",8087);
|
|
|
+ studio_udp client("0.0.0.0", 8089, "192.168.3.20", 8087);
|
|
|
// 设置普通函数作为回调
|
|
|
// 设置接收数据的回调函数
|
|
|
client.set_receive_callback(on_message_received_client);
|
|
@@ -111,7 +111,6 @@ int main()
|
|
|
std::cerr << "Failed to start UDP service." << std::endl;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// // 发送一些测试消息
|
|
|
// while (true)
|
|
|
// {
|