Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions executor/cpp-common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ add_library(deepx_common SHARED

find_package(yaml-cpp REQUIRED)

target_link_libraries(deepx_common
PUBLIC
yaml-cpp
)
if (TARGET yaml-cpp::yaml-cpp)
target_link_libraries(deepx_common PUBLIC yaml-cpp::yaml-cpp)
else()
target_link_libraries(deepx_common PUBLIC yaml-cpp)
endif()

target_include_directories(deepx_common PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
Expand Down
12 changes: 6 additions & 6 deletions executor/cpp-common/src/client/udpserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace client
{
if (sockfd > 0)
{
close(sockfd);
::close(sockfd);
}
}
void udpserver::start(queue<deepx::tf::TF> &queue)
Expand All @@ -33,16 +33,16 @@ namespace client
servaddr.sin_addr.s_addr = INADDR_ANY;
servaddr.sin_port = htons(port);

if (bind(sockfd, (const struct sockaddr *)&servaddr, sizeof(servaddr)) < 0)
if (::bind(sockfd, (const struct sockaddr *)&servaddr, (socklen_t)sizeof(servaddr)) < 0)
{
perror("bind failed");
close(sockfd);
::close(sockfd);
exit(EXIT_FAILURE);
}
while (true)
{
len = sizeof(cliaddr);
n = recvfrom(sockfd, buffer, sizeof(buffer), 0, (struct sockaddr *)&cliaddr, &len);
n = ::recvfrom(sockfd, buffer, sizeof(buffer), 0, (struct sockaddr *)&cliaddr, &len);
buffer[n] = '\0';

// 新增换行拆分逻辑
Expand All @@ -57,10 +57,10 @@ namespace client
}
}
}
close(sockfd);
::close(sockfd);
}
void udpserver::resp(string str){
sendto(sockfd, str.c_str(), str.size(), 0, // 改为sendto
::sendto(sockfd, str.c_str(), str.size(), 0, // 改为sendto
(const struct sockaddr *)&cliaddr, sizeof(cliaddr));
}
}
1 change: 0 additions & 1 deletion executor/cpp-common/src/deepx/shape_range.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include <any>
#include <thread>

#include <omp.h>
#include "deepx/shape.hpp"
namespace deepx
{
Expand Down