Moved InetAddress from trantor to core.

This commit is contained in:
Relintai 2022-02-09 20:39:54 +01:00
parent 9f39b21574
commit a60b4681b6
18 changed files with 20 additions and 22 deletions

View File

@ -6,6 +6,7 @@ env.core_sources = []
env.add_source_files(env.core_sources, "*.cpp")
env.add_source_files(env.core_sources, "./math/*.cpp")
env.add_source_files(env.core_sources, "./net/*.cpp")
env.add_source_files(env.core_sources, "./containers/*.cpp")
env.add_source_files(env.core_sources, "./log/*.cpp")
env.add_source_files(env.core_sources, "./os/*.cpp")

View File

@ -6,10 +6,7 @@
// Author: Shuo Chen (chenshuo at chenshuo dot com)
#include <trantor/net/InetAddress.h>
#include <trantor/utils/Logger.h>
//#include <muduo/net/Endian.h>
#include "inet_address.h"
#ifdef _WIN32
struct in6_addr_uint {
@ -23,6 +20,7 @@ struct in6_addr_uint {
#include <netdb.h>
#include <netinet/tcp.h>
#include <strings.h> // memset
#include <cstring>
#endif
// INADDR_ANY use (type)value casting.

View File

@ -20,8 +20,6 @@
#ifndef MUDUO_NET_INETADDRESS_H
#define MUDUO_NET_INETADDRESS_H
#include <trantor/exports.h>
#ifdef _WIN32
#include <ws2tcpip.h>
using sa_family_t = unsigned short;
@ -35,13 +33,14 @@ using uint16_t = unsigned short;
#include <string>
#include <unordered_map>
#include <mutex>
namespace trantor
{
/**
* @brief Wrapper of sockaddr_in. This is an POD interface class.
*
*/
class TRANTOR_EXPORT InetAddress
class InetAddress
{
public:
/**

View File

@ -15,7 +15,7 @@
#pragma once
#include <http/HttpTypes.h>
#include <trantor/net/InetAddress.h>
#include "core/net/inet_address.h"
#include <trantor/utils/NonCopyable.h>
#include <memory>
#include <string>

View File

@ -15,7 +15,7 @@
#pragma once
#include <trantor/net/EventLoop.h>
#include <trantor/net/InetAddress.h>
#include "core/net/inet_address.h"
#include "core/math/date.h"
#include <trantor/utils/Logger.h>

View File

@ -21,7 +21,7 @@
#include <drogon/utils/string_view.h>
#include <json/json.h>
#include <trantor/net/InetAddress.h>
#include "core/net/inet_address.h"
#include "core/math/date.h"
#include <memory>
#include <string>

View File

@ -21,7 +21,7 @@
#include <drogon/utils/Utilities.h>
#include <stdio.h>
#include <trantor/net/EventLoop.h>
#include <trantor/net/InetAddress.h>
#include "core/net/inet_address.h"
#include <trantor/utils/Logger.h>
#include <trantor/utils/MsgBuffer.h>
#include <trantor/utils/NonCopyable.h>

View File

@ -19,7 +19,7 @@
#include <http/HttpResponse.h>
#include <drogon/utils/Utilities.h>
#include <trantor/net/InetAddress.h>
#include "core/net/inet_address.h"
#include "core/math/date.h"
#include <trantor/utils/MsgBuffer.h>
#include <atomic>

View File

@ -21,7 +21,7 @@
#include "WebSocketConnectionImpl.h"
#include <drogon/utils/Utilities.h>
#include <trantor/net/InetAddress.h>
#include "core/net/inet_address.h"
#ifdef OPENSSL_FOUND
#include <openssl/sha.h>
#else

View File

@ -12,7 +12,7 @@
#include <memory>
#include <mutex>
#include <trantor/net/InetAddress.h>
#include "core/net/inet_address.h"
#include <trantor/net/Resolver.h>
#include <trantor/utils/Logger.h>

View File

@ -9,7 +9,7 @@
#include <trantor/exports.h>
#include <memory>
#include <trantor/net/EventLoop.h>
#include <trantor/net/InetAddress.h>
#include "core/net/inet_address.h"
namespace trantor
{

View File

@ -18,7 +18,7 @@
#pragma once
#include <trantor/net/EventLoop.h>
#include <trantor/net/InetAddress.h>
#include "core/net/inet_address.h"
#include <trantor/net/TcpConnection.h>
#include <trantor/exports.h>
#include <functional>

View File

@ -15,7 +15,7 @@
#pragma once
#include <trantor/exports.h>
#include <trantor/net/EventLoop.h>
#include <trantor/net/InetAddress.h>
#include "core/net/inet_address.h"
#include <trantor/utils/NonCopyable.h>
#include <trantor/utils/MsgBuffer.h>
#include <trantor/net/callbacks.h>

View File

@ -17,7 +17,7 @@
#include <trantor/utils/NonCopyable.h>
#include <trantor/utils/Logger.h>
#include <trantor/net/EventLoopThreadPool.h>
#include <trantor/net/InetAddress.h>
#include "core/net/inet_address.h"
#include <trantor/net/TcpConnection.h>
#include <trantor/utils/TimingWheel.h>
#include <trantor/exports.h>

View File

@ -17,7 +17,7 @@
#include <trantor/net/EventLoop.h>
#include <trantor/utils/NonCopyable.h>
#include "Socket.h"
#include <trantor/net/InetAddress.h>
#include "core/net/inet_address.h"
#include "Channel.h"
#include <functional>

View File

@ -15,7 +15,7 @@
#pragma once
#include <trantor/net/EventLoop.h>
#include <trantor/net/InetAddress.h>
#include "core/net/inet_address.h"
#include <atomic>
#include <memory>

View File

@ -15,7 +15,7 @@
#pragma once
#include <trantor/utils/NonCopyable.h>
#include <trantor/net/InetAddress.h>
#include "core/net/inet_address.h"
#include <trantor/utils/Logger.h>
#include <string>
#ifndef _WIN32

View File

@ -1,4 +1,4 @@
#include <trantor/net/InetAddress.h>
#include "core/net/inet_address.h"
#include <gtest/gtest.h>
#include <string>
#include <iostream>