diff --git a/build/projects/moon/Makefile b/build/projects/moon/Makefile index 1ebe20e19..857a9bcf5 100644 --- a/build/projects/moon/Makefile +++ b/build/projects/moon/Makefile @@ -69,7 +69,7 @@ all: prebuild prelink $(TARGET) endif OBJECTS := \ - $(OBJDIR)/socket.o \ + $(OBJDIR)/socket_server.o \ $(OBJDIR)/server.o \ $(OBJDIR)/worker.o \ $(OBJDIR)/moon.o \ @@ -132,7 +132,7 @@ else $(OBJECTS): | $(OBJDIR) endif -$(OBJDIR)/socket.o: ../../../moon-src/core/network/socket.cpp +$(OBJDIR)/socket_server.o: ../../../moon-src/core/network/socket_server.cpp @echo $(notdir $<) $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" $(OBJDIR)/server.o: ../../../moon-src/core/server.cpp diff --git a/build/projects/moon/moon.vcxproj b/build/projects/moon/moon.vcxproj index d975baa59..05411d6df 100644 --- a/build/projects/moon/moon.vcxproj +++ b/build/projects/moon/moon.vcxproj @@ -114,7 +114,7 @@ - + @@ -124,7 +124,7 @@ - + diff --git a/build/projects/moon/moon.vcxproj.filters b/build/projects/moon/moon.vcxproj.filters index aedadc170..5865efb42 100644 --- a/build/projects/moon/moon.vcxproj.filters +++ b/build/projects/moon/moon.vcxproj.filters @@ -33,7 +33,7 @@ core\network - + core\network @@ -59,7 +59,7 @@ - + core\network diff --git a/lualib-src/lua_moon.cpp b/lualib-src/lua_moon.cpp index 9b7a5aea2..5f80b327c 100644 --- a/lualib-src/lua_moon.cpp +++ b/lualib-src/lua_moon.cpp @@ -667,7 +667,7 @@ static int lasio_udp(lua_State* L) address = std::string_view{ addr, size }; port = (asio::ip::port_type)luaL_checkinteger(L, 2); } - uint32_t fd = sock.udp(S->id(), address, port); + uint32_t fd = sock.udp_open(S->id(), address, port); lua_pushinteger(L, fd); return 1; } diff --git a/moon-src/core/network/socket.cpp b/moon-src/core/network/socket_server.cpp similarity index 99% rename from moon-src/core/network/socket.cpp rename to moon-src/core/network/socket_server.cpp index bf84347dc..c159cc558 100644 --- a/moon-src/core/network/socket.cpp +++ b/moon-src/core/network/socket_server.cpp @@ -77,7 +77,7 @@ std::pair socket_server::listen(const std::string & hos } } -uint32_t socket_server::udp(uint32_t owner, std::string_view host, uint16_t port) +uint32_t socket_server::udp_open(uint32_t owner, std::string_view host, uint16_t port) { try { diff --git a/moon-src/core/network/socket.h b/moon-src/core/network/socket_server.h similarity index 98% rename from moon-src/core/network/socket.h rename to moon-src/core/network/socket_server.h index dea8c0545..a69e178d5 100644 --- a/moon-src/core/network/socket.h +++ b/moon-src/core/network/socket_server.h @@ -92,7 +92,7 @@ namespace moon std::pair listen(const std::string& host, uint16_t port, uint32_t owner, uint8_t type); - uint32_t udp(uint32_t owner, std::string_view host, uint16_t port); + uint32_t udp_open(uint32_t owner, std::string_view host, uint16_t port); bool udp_connect(uint32_t fd, std::string_view host, uint16_t port); diff --git a/moon-src/core/worker.h b/moon-src/core/worker.h index 7cd168932..362e65926 100644 --- a/moon-src/core/worker.h +++ b/moon-src/core/worker.h @@ -1,7 +1,7 @@ #pragma once #include "config.hpp" #include "common/concurrent_queue.hpp" -#include "network/socket.h" +#include "network/socket_server.h" namespace moon {