리눅스랑 코드 동기화
This commit is contained in:
@@ -1,28 +1,60 @@
|
||||
#include "Session/Session.hpp"
|
||||
|
||||
namespace Chattr {
|
||||
|
||||
Session::Session(Chattr::TCPSocket __sock) {
|
||||
init(std::move(__sock));
|
||||
}
|
||||
|
||||
Session::~Session() {
|
||||
destruct();
|
||||
}
|
||||
|
||||
void Session::init(Chattr::TCPSocket __sock) {
|
||||
|
||||
}
|
||||
|
||||
void Session::destruct() {
|
||||
}
|
||||
|
||||
int Session::send() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int Session::recv() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
//#include "Session/Session.hpp"
|
||||
//#include "Socket/Log.hpp"
|
||||
//#include "precomp.hpp"
|
||||
//#include <thread>
|
||||
//
|
||||
//namespace Chattr {
|
||||
//
|
||||
//Session::Session(Chattr::TCPSocket __sock) {
|
||||
// init(std::move(__sock));
|
||||
//}
|
||||
//
|
||||
//Session::~Session() {
|
||||
// destruct();
|
||||
//}
|
||||
//
|
||||
//void Session::init(Chattr::TCPSocket __sock) {
|
||||
// sock_ = std::move(__sock);
|
||||
//}
|
||||
//
|
||||
//void Session::destruct() {
|
||||
//}
|
||||
//
|
||||
//TCPSocket Session::reconnect(Chattr::TCPSocket __sock, int maxTry) {
|
||||
// int retVal = 0;
|
||||
// int backoffTime = 2;
|
||||
//
|
||||
// __sock.destruct();
|
||||
//
|
||||
// spdlog::info("Lost connection.");
|
||||
// while (maxTry--) {
|
||||
// backoffTime *= backoffTime;
|
||||
// spdlog::info("Attempt to reconnect in {}s...", backoffTime);
|
||||
// std::this_thread::sleep_for(std::chrono::seconds(backoffTime));
|
||||
// TCPSocket sock;
|
||||
//
|
||||
// retVal = sock.init(__sock.domain);
|
||||
// if (retVal == INVALID_SOCKET || retVal == SOCKET_ERROR) {
|
||||
// log::error("init()");
|
||||
// continue;
|
||||
// }
|
||||
// retVal = sock.connect(__sock.remoteAddr);
|
||||
// if (retVal == INVALID_SOCKET || retVal == SOCKET_ERROR) {
|
||||
// log::error("connect()");
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// return sock;
|
||||
// }
|
||||
// return TCPSocket();
|
||||
//}
|
||||
//
|
||||
//int Session::recv(void* __restrict __buf, size_t __n, int __flags) {
|
||||
// return -1;
|
||||
//}
|
||||
//
|
||||
//int Session::send(const void* __buf, size_t __n, int __flags) {
|
||||
// return -1;
|
||||
//}
|
||||
//
|
||||
//}
|
||||
2
impl/Session/SessionManager.cpp
Normal file
2
impl/Session/SessionManager.cpp
Normal file
@@ -0,0 +1,2 @@
|
||||
// #include "Session/SessionManager.hpp"
|
||||
#include "precomp.hpp"
|
||||
Reference in New Issue
Block a user