Samchon Framework for CPP
1.0.0
|
Relationship between IP address and User for issuing session. More...
#include <IPUserPair.hpp>
Private Member Functions | |
IPUserPair (Server *server, const std::string &) | |
Construct from Server and IP address. More... | |
auto | getSessionID (Socket *, size_t) -> std::string |
Get a session ID. More... | |
auto | issueSessionID (size_t) const -> std::string |
Issue a session ID. More... | |
Private Attributes | |
Server * | server |
The Server containing IP addresses and User(s) More... | |
std::string | ip |
An IP address. More... | |
std::set< const User * > | userSet |
User(s) belongs to the IP address. More... | |
Relationship between IP address and User for issuing session.
IPUserPair is a class representing 1:N relationship between IP address and User.
The key role of IPUserPair is to issuing session ID, that is published to User(s), within a critical section of an IP address.
Samchon Framework is for Cloud Server basically, so I've adopted Session ID to discriminate unique User to follow standard. But I think there can be another good strategies something like a using MAC address instead of publishing Session-ID to discriminate uniqueness of User. It's okay to adapt those strategies and rebuild my framework's source to be suitable for those.
When changing the strategy, you've to careful about policy of each system or libraries.
Followings are something to consider when adjusting MAC address for uniqueness.
Definition at line 51 of file IPUserPair.hpp.
|
private |
Construct from Server and IP address.
Definition at line 25 of file IPUserPair.cpp.
|
private |
Get a session ID.
Asks Whether client to have a session id stored in cookie.
If client has, get the session id from client, but if not, issues a new session ID and notify it(enrolled new session ID) to client. Additionally, if the session id was gotten from a client, inspect validate of the session ID.
Those tasks will hold a critical section of a global IP address
Definition at line 30 of file IPUserPair.cpp.
|
private |
Issue a session ID.
Issues a session ID when a target client haven't issued seesion ID yet
$linux_time: Linux time of current time.
If the object Server is re-constructed, $sequence can be duplicated. $linux_time is to avoid the duplication so that can ensure uniqueness on session id
Definition at line 81 of file IPUserPair.cpp.
References samchon::library::Date::toLinuxTime().
|
private |
The Server containing IP addresses and User(s)
Definition at line 60 of file IPUserPair.hpp.
|
private |
An IP address.
Definition at line 65 of file IPUserPair.hpp.
Referenced by samchon::protocol::service::Server::addClient().
|
private |
User(s) belongs to the IP address.
Definition at line 70 of file IPUserPair.hpp.
Referenced by samchon::protocol::service::Server::addClient().