.dll .so 복사 자동화 완료
This commit is contained in:
21
include/Session/Session.hpp
Normal file
21
include/Session/Session.hpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
#include "Socket/TCPSocket.hpp"
|
||||
#include <vector>
|
||||
|
||||
namespace Chattr {
|
||||
class Session {
|
||||
public:
|
||||
Session();
|
||||
~Session();
|
||||
|
||||
bool init();
|
||||
void destruct();
|
||||
|
||||
int send();
|
||||
int recv();
|
||||
|
||||
private:
|
||||
struct std::vector<Chattr::TCPSocket> tcpSock_;
|
||||
struct std::vector<Chattr::Socket> udpSock_;
|
||||
};
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
namespace Chattr {
|
||||
class Sesson {
|
||||
public:
|
||||
Sesson();
|
||||
~Session();
|
||||
|
||||
bool init();
|
||||
void destruct();
|
||||
|
||||
int send();
|
||||
int recv();
|
||||
|
||||
private:
|
||||
struct std::vector<Chattr::TCPSocket> sock;
|
||||
struct std::vector<Chattr::Socket> sock;
|
||||
};
|
||||
}
|
||||
@@ -15,8 +15,7 @@ public:
|
||||
void destruct();
|
||||
|
||||
operator SOCKET() const;
|
||||
void move(const SOCKET);
|
||||
Socket& move();
|
||||
void set(const SOCKET);
|
||||
|
||||
void bind(sockaddr *__addr);
|
||||
void bind(sockaddr *__addr, socklen_t __len);
|
||||
@@ -29,6 +28,9 @@ public:
|
||||
void bind(sockaddr_in6 *__addr);
|
||||
void bind(sockaddr_in6 *__addr, socklen_t __len);
|
||||
|
||||
int recvfrom(void *__restrict __buf, size_t __n, int __flags, struct Address& __addr);
|
||||
int sendto(const void *__buf, size_t __n, int __flags, struct Address __addr);
|
||||
|
||||
Socket(const Socket&) = delete;
|
||||
Socket(Socket&&);
|
||||
Socket& operator=(const Socket&) = delete;
|
||||
|
||||
@@ -11,6 +11,8 @@ public:
|
||||
void listen(int __n);
|
||||
void accept(TCPSocket& newSock, Address& addr);
|
||||
void connect(Chattr::Address& serveraddr);
|
||||
int recv(void *__restrict __buf, size_t __n, int __flags);
|
||||
int send(const void *__buf, size_t __n, int __flags);
|
||||
};
|
||||
|
||||
}
|
||||
17
include/Utils/Snowflake.hpp
Normal file
17
include/Utils/Snowflake.hpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
|
||||
namespace Chattr {
|
||||
|
||||
struct Snowflake {
|
||||
union {
|
||||
struct {
|
||||
std::uint64_t timestamp : 42;
|
||||
std::uint64_t instance : 10;
|
||||
std::uint64_t sequence : 12;
|
||||
};
|
||||
std::uint64_t snowflake;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
~Thread();
|
||||
|
||||
void join();
|
||||
void deatch();
|
||||
void detach();
|
||||
|
||||
private:
|
||||
#ifdef _WIN32
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <netinet/in.h>
|
||||
#define SOCKET int
|
||||
#define INVALID_SOCKET -1
|
||||
#define SOCKET_ERROR -1
|
||||
#else
|
||||
#error "이 플랫폼은 지원되지 않습니다."
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user