iFun Engine API  1.0.0-b2908
Great Technology for Great Games
 All Classes Files Functions Variables Typedefs Macros
Classes | Typedefs | Enumerations | Functions
session.h File Reference
#include <boost/noncopyable.hpp>
#include <boost/unordered_set.hpp>
#include <funapi/common/json.h>
#include <funapi/common/json_schema.h>
#include <funapi/distribution/rpc.h>
#include <funapi/network/fun_message.pb.h>
#include <funapi/time/monotonic_clock.h>
#include <funapi/time/wall_clock.h>
#include <funapi/types.h>
#include <vector>
#include <cxxabi.h>

Go to the source code of this file.

Classes

class  fun::HandlerRegistry
 
class  fun::ProtobufExtensionIdentifier
 
class  fun::Session
 

Typedefs

typedef function< void(const
Ptr< Session > &, const Json
&, const string &, size_t
message_size)> 
fun::JsonMessageSendHook
 
typedef function< void(const
Ptr< Session > &, const Json
&, const string &)> 
fun::JsonPostMessageHandlerHook
 
typedef function< bool(const
Ptr< Session > &, const Json
&, const string &)> 
fun::JsonPreMessageHandlerHook
 
typedef function< void(const
Ptr< Session > &, const Json &)> 
fun::MessageHandler
 JSON message handler type.
 
typedef function< void(const
Ptr< Session > &, const Ptr
< FunMessage > &)> 
fun::MessageHandler2
 Protobuf message handler type.
 
typedef function< void(const
Ptr< Session > &, const Ptr
< const FunMessage > &, const
string &, size_t message_size)> 
fun::ProtobufMessageSendHook
 
typedef function< void(const
Ptr< Session > &, const Ptr
< const FunMessage > &, const
string &)> 
fun::ProtobufPostMessageHandlerHook
 
typedef function< void(const
Ptr< Session > &, const Ptr
< const FunMessage > &, const
int32_t)> 
fun::ProtobufPostMessageHandlerHook2
 
typedef function< bool(const
Ptr< Session > &, const Ptr
< const FunMessage > &, const
string &)> 
fun::ProtobufPreMessageHandlerHook
 
typedef function< bool(const
Ptr< Session > &, const Ptr
< const FunMessage > &, const
int32_t)> 
fun::ProtobufPreMessageHandlerHook2
 
typedef function< void(const
Ptr< Session > &)> 
fun::SessionClosedHandler
 Handler to be notified on session close. This one ignores the close reason.
 
typedef function< void(const
Ptr< Session >
&, SessionCloseReason)> 
fun::SessionClosedHandler2
 Handler to be notified on session close. This one ignores the close reason.
 
typedef Uuid fun::SessionId
 
typedef function< void(const
Ptr< Session > &)> 
fun::SessionOpenedHandler
 Handler to be notified on session creation.
 
typedef function< void(const
Ptr< Session > &)> 
fun::SessionRestoredHandler
 Handler to be notified on session restoration.
 
typedef function< void(const
Ptr< Session > &)> 
fun::TcpTransportAttachedHandler
 Handler to to noticed on TCP connect if the session uses TCP.
 
typedef function< void(const
Ptr< Session > &)> 
fun::TcpTransportDetachedHandler
 Handler to be notified on TCP close if the session uses TCP.
 

Enumerations

enum  EncodingScheme { kUnknownEncoding = 0, kJsonEncoding, kProtobufEncoding }
 
enum  Encryption {
  kDefaultEncryption = 100, kDummyEncryption, kIFunEngine1Encryption, kIFunEngine2Encryption,
  kChacha20Encryption, kAes128Encryption
}
 
enum  SessionCloseReason { fun::kClosedForServerDid = 0, fun::kClosedForIdle, fun::kClosedForUnknownSessionId }
 Enumeration to identify why a session has closed.
 
enum  TransportProtocol {
  kDefaultProtocol = 0, kTcp, kUdp, kHttp,
  kWebSocket
}
 

Functions

void fun::InstallJsonMessageHandlerHook (const JsonPreMessageHandlerHook &json_pre_message_handler_hook, const JsonPostMessageHandlerHook &json_post_message_handler_hook)
 
void fun::InstallJsonMessageSendHook (const JsonMessageSendHook &hook)
 
void fun::InstallProtobufMessageHandlerHook (const ProtobufPreMessageHandlerHook &protobuf_pre_message_handler_hook, const ProtobufPostMessageHandlerHook &protobuf_post_message_handler_hook)
 
void fun::InstallProtobufMessageHandlerHook2 (const ProtobufPreMessageHandlerHook2 &protobuf_pre_message_handler_hook, const ProtobufPostMessageHandlerHook2 &protobuf_post_message_handler_hook)
 
void fun::InstallProtobufMessageSendHook (const ProtobufMessageSendHook &hook)
 
bool fun::operator== (const int32_t lhs, const ProtobufExtensionIdentifier &rhs)
 
bool fun::operator== (const ProtobufExtensionIdentifier lhs, const int32_t &rhs)
 
void fun::SetTransport (TransportProtocol protocol)
 
void fun::SetTransport (TransportProtocol protocol, const string &msgtype)