ProudNet: Server and Network

Please refer to ProudNet : Server and Network for description of this module. More...

Classes

class  Proud::CRemoteOfflineEventArgs
 
class  Proud::CRemoteOnlineEventArgs
 
struct  Proud::AddrPort
 
struct  Proud::NamedAddrPort
 
class  Proud::CNetUtil
 
class  Proud::CNetConnectionParam
 
class  Proud::ErrorInfo
 
class  Proud::HostIDArray
 
class  Proud::HostIDSet
 
class  Proud::INetClientEvent
 
class  Proud::CUserWorkerThreadCallbackContext
 
class  Proud::INetCoreEvent
 
class  Proud::INetServerEvent
 
class  Proud::IRmiHost
 ProudNet Network host interface that is referred by RMI. User does not have to use this class directly. More...
 
class  Proud::CClientWorkerInfo
 Structure that contain information of clientWorker. More...
 
class  Proud::CSocketInfo
 Structure that contain information of socket. More...
 
class  Proud::CThreadInfo
 Construct contains information of 1 thread. More...
 
class  Proud::CApplicationHint
 user program to engine More...
 
class  Proud::ReliableUdpHostStats
 statistics information. For debugging or performance test More...
 
class  Proud::CTestStats
 
class  Proud::CTestStats2
 
class  Proud::CDisconnectArgs
 
class  Proud::IRmiProxy
 
class  Proud::IRmiStub
 
class  Proud::CMessage
 
class  Proud::CSmallStackAllocMessage
 
class  Proud::MessageSummary
 
class  Proud::AfterRmiSummary
 
class  Proud::CNetClientInfo
 
class  Proud::CFrameMoveResult
 client FrameMove process result More...
 
class  Proud::CServerConnectionState
 Acquired result of the connection status to server. More...
 
class  Proud::CDirectP2PInfo
 Information that contains addresses and others for internal P2P communication in ProudNet. Used at CNetClient.GetDirectP2PInfo and so on. More...
 
class  Proud::CNetClient
 Network Client. More...
 
class  Proud::CNetConfig
 
class  Proud::CNetPeerInfo
 
struct  Proud::SuperPeerRating
 Each element of array filled at GetSuitableSuperPeerRankListInGroup. More...
 
class  Proud::CSuperPeerSelectionPolicy
 super peer selection policy More...
 
class  Proud::CP2PConnectionStats
 Statistics to P2P connection. More...
 
class  Proud::CP2PPairConnectionStats
 Number of attempt and success Udp messaging between RemoteA and Remote B. More...
 
class  Proud::CNetServer
 Gaming network server. More...
 
class  Proud::CStartServerParameter
 
class  Proud::CServiceParameter
 
class  Proud::CNTServiceStartParameter
 
class  Proud::CP2PGroup
 
class  Proud::CP2PGroups
 
class  Proud::CP2PGroupOption
 
class  Proud::SendFailedRemote
 
class  Proud::RmiContext
 
class  Proud::OverlappedResult
 
class  Proud::SocketSelectContext
 
class  Proud::ISocketDelegate
 
class  Proud::CSocket
 
class  Proud::CStartServerParameterBase
 
class  Proud::IThreadPoolEvent
 
class  Proud::CThreadPool
 

Typedefs

typedef uint16_t Proud::RmiID
 
typedef RefCount< ErrorInfo > Proud::ErrorInfoPtr
 
typedef RefCount< CP2PGroup > Proud::CP2PGroupPtr
 
typedef void(* Proud::RunAsyncFunction )(void *)
 

Enumerations

enum  Proud::SocketErrorCode {
  SocketErrorCode_Ok = 0, SocketErrorCode_Error = SOCKET_ERROR, SocketErrorCode_Timeout = WSAETIMEDOUT, SocketErrorCode_ConnectionRefused = WSAECONNREFUSED,
  SocketErrorCode_ConnectResetByRemote = WSAECONNRESET, SocketErrorCode_AddressNotAvailable = WSAEADDRNOTAVAIL, SocketErrorCode_NotSocket = WSAENOTSOCK, SocketErrorCode_ShutdownByRemote = WSAEDISCON,
  SocketErrorCode_WouldBlock = WSAEWOULDBLOCK, SocketErrorCode_IoPending = WSA_IO_PENDING, SocketErrorCode_AccessError = WSAEACCES, SocketErrorCode_OperationAborted = ERROR_OPERATION_ABORTED,
  SocketErrorCode_InvalidArgument = WSAEINVAL, SocketErrorCode_Intr = WSAEINTR, SocketErrorCode_InProgress = WSAEINPROGRESS, SocketErrorCode_AlreadyIsConnected = WSAEISCONN,
  SocketErrorCode_AlreadyAttempting = WSAEALREADY, SocketErrorCode_Cancelled = WSAECANCELLED, SocketErrorCode_NetUnreachable = WSAENETUNREACH
}
 
enum  ShutdownFlag { ShutdownFlag_Send = SD_SEND, ShutdownFlag_Receive = SD_RECEIVE, ShutdownFlag_Both = SD_BOTH }
 
enum  Proud::CompressMode { Proud::CM_None, Proud::CM_Zip }
 
enum  Proud::EncryptMode { Proud::EM_None, Proud::EM_Secure, Proud::EM_Fast, EM_LAST }
 
enum  Proud::MessagePriority {
  MessagePriority_Ring0 = 0, MessagePriority_Ring1, Proud::MessagePriority_High, Proud::MessagePriority_Medium,
  Proud::MessagePriority_Low, MessagePriority_Ring99, MessagePriority_LAST
}
 
enum  MessageReliability { MessageReliability_Unreliable = 0, MessageReliability_Reliable, MessageReliability_LAST }
 
enum  Proud::HostID { Proud::HostID_None = 0, Proud::HostID_Server = 1, Proud::HostID_Last = 2 }
 
enum  _RmiID { RmiID_None = 0, RmiID_Last = 65535 }
 
enum  Proud::LogCategory { Proud::LogCategory_System, Proud::LogCategory_Tcp, Proud::LogCategory_Udp, Proud::LogCategory_P2P }
 
enum  Proud::HackType { Proud::HackType_None, Proud::HackType_SpeedHack, Proud::HackType_PacketRig }
 
enum  Proud::ConnectionState { Proud::ConnectionState_Disconnected, Proud::ConnectionState_Connecting, Proud::ConnectionState_Connected, Proud::ConnectionState_Disconnecting }
 
enum  Proud::FallbackMethod { Proud::FallbackMethod_None, Proud::FallbackMethod_PeersUdpToTcp, Proud::FallbackMethod_ServerUdpToTcp, Proud::FallbackMethod_CloseUdpSocket }
 
enum  Proud::DirectP2PStartCondition { Proud::DirectP2PStartCondition_Jit, Proud::DirectP2PStartCondition_Always, DirectP2PStartCondition_LAST }
 
enum  Proud::MiniDumpAction { Proud::MiniDumpAction_None = 0, Proud::MiniDumpAction_DoNothing, Proud::MiniDumpAction_AlarmCrash }
 
enum  Proud::ServerUdpAssignMode { Proud::ServerUdpAssignMode_None, Proud::ServerUdpAssignMode_PerClient, Proud::ServerUdpAssignMode_Static }
 
enum  SocketType { SocketType_Tcp, SocketType_Udp, SocketType_Raw, SocketType_WebSocket }
 
enum  Proud::RunAsyncType { Proud::RunAsyncType_Single, Proud::RunAsyncType_Parallel }
 

Functions

void Proud::AppendTextOut (String &a, const AddrPort &b)
 
void Proud::AppendTextOut (String &a, const NamedAddrPort &b)
 
int Proud::CompareHostID (HostID lhs, HostID rhs)
 
PROUD_API const PNTCHAR * Proud::ToString (LogCategory logCategory)
 
PROUD_API const PNTCHAR * Proud::ToString (ConnectionState val)
 
void Proud::ThrowExceptionOnReadString (int length)
 
PROUD_API void Proud::ThrowExceptionOnReadArray (int64_t length)
 
CMessage & Proud::operator<< (CMessage &a, const StringA &str)
 
CMessage & Proud::operator>> (CMessage &a, StringA &str)
 
CMessage & Proud::operator<< (CMessage &a, const StringW &str)
 
CMessage & Proud::operator>> (CMessage &a, StringW &str)
 
CMessage & Proud::operator<< (CMessage &a, const std::string &str)
 
CMessage & Proud::operator>> (CMessage &a, std::string &str)
 
CMessage & Proud::operator<< (CMessage &a, const std::wstring &str)
 
CMessage & Proud::operator>> (CMessage &a, std::wstring &str)
 
CMessage & Proud::operator<< (CMessage &a, const char *str)
 
CMessage & Proud::operator<< (CMessage &a, const wchar_t *str)
 
CMessage & Proud::operator<< (CMessage &a, bool b)
 
CMessage & Proud::operator<< (CMessage &a, int8_t b)
 
CMessage & Proud::operator<< (CMessage &a, uint8_t b)
 
CMessage & Proud::operator<< (CMessage &a, int16_t b)
 
CMessage & Proud::operator<< (CMessage &a, uint16_t b)
 
CMessage & Proud::operator<< (CMessage &a, int32_t b)
 
CMessage & Proud::operator<< (CMessage &a, uint32_t b)
 
CMessage & Proud::operator<< (CMessage &a, uint64_t b)
 
CMessage & Proud::operator<< (CMessage &a, int64_t b)
 
CMessage & Proud::operator<< (CMessage &a, float b)
 
CMessage & Proud::operator<< (CMessage &a, double b)
 
CMessage & Proud::operator>> (CMessage &a, bool &b)
 
CMessage & Proud::operator>> (CMessage &a, int8_t &b)
 
CMessage & Proud::operator>> (CMessage &a, uint8_t &b)
 
CMessage & Proud::operator>> (CMessage &a, int16_t &b)
 
CMessage & Proud::operator>> (CMessage &a, uint16_t &b)
 
CMessage & Proud::operator>> (CMessage &a, int32_t &b)
 
CMessage & Proud::operator>> (CMessage &a, uint32_t &b)
 
CMessage & Proud::operator>> (CMessage &a, uint64_t &b)
 
CMessage & Proud::operator>> (CMessage &a, int64_t &b)
 
CMessage & Proud::operator>> (CMessage &a, float &b)
 
CMessage & Proud::operator>> (CMessage &a, double &b)
 
CMessage & Proud::operator>> (CMessage &a, AddrPort &b)
 
CMessage & Proud::operator<< (CMessage &a, AddrPort b)
 
CMessage & Proud::operator>> (CMessage &a, ByteArray &b)
 
CMessage & Proud::operator<< (CMessage &a, const ByteArray &b)
 
CMessage & Proud::operator>> (CMessage &a,::timespec &tc)
 
CMessage & Proud::operator<< (CMessage &a, const ::timespec &tc)
 
template<typename elem , bool elem_in_ref, bool RAWTYPE, typename INDEXTYPE >
CMessage & Proud::operator>> (CMessage &a, CFastArray< elem, elem_in_ref, RAWTYPE, INDEXTYPE > &b)
 
template<typename elem , bool elem_in_ref, bool RAWTYPE, typename INDEXTYPE >
CMessage & Proud::operator<< (CMessage &a, const CFastArray< elem, elem_in_ref, RAWTYPE, INDEXTYPE > &b)
 
PROUD_API CMessage & Proud::operator<< (CMessage &a, const NamedAddrPort &b)
 
PROUD_API CMessage & Proud::operator>> (CMessage &a, NamedAddrPort &b)
 
PROUD_API void Proud::AppendTextOut (String &a, const bool &b)
 
PROUD_API void Proud::AppendTextOut (String &a, const int8_t &b)
 
PROUD_API void Proud::AppendTextOut (String &a, const uint8_t &b)
 
PROUD_API void Proud::AppendTextOut (String &a, const int16_t &b)
 
PROUD_API void Proud::AppendTextOut (String &a, const uint16_t &b)
 
PROUD_API void Proud::AppendTextOut (String &a, const int32_t &b)
 
PROUD_API void Proud::AppendTextOut (String &a, const uint32_t &b)
 
PROUD_API void Proud::AppendTextOut (String &a, const int64_t &b)
 
PROUD_API void Proud::AppendTextOut (String &a, const uint64_t &b)
 
PROUD_API void Proud::AppendTextOut (String &a, const float &b)
 
PROUD_API void Proud::AppendTextOut (String &a, const double &b)
 
PROUD_API void Proud::AppendTextOut (String &a, const char *&b)
 
PROUD_API void Proud::AppendTextOut (String &a, const wchar_t *&b)
 
PROUD_API void Proud::AppendTextOut (String &a, const StringA &b)
 
PROUD_API void Proud::AppendTextOut (String &a, const StringW &b)
 
void Proud::AppendTextOut (String &a, const std::string &b)
 
void Proud::AppendTextOut (String &a, const std::wstring &b)
 
PROUD_API void Proud::AppendTextOut (String &a, const POINT &b)
 
template<typename elem >
void Proud::AppendTextOut (String &a, const CFastArray< elem > &b)
 
PROUD_API void Proud::AppendTextOut (String &a, const ByteArray &b)
 
PROUD_API void Proud::AppendTextOut (String &a, const ::timespec &b)
 
template<typename FloatType >
CMessage & Proud::operator>> (CMessage &a, Vector3T< FloatType > &b)
 
template<typename FloatType >
CMessage & Proud::operator<< (CMessage &a, const Vector3T< FloatType > &b)
 
void Proud::AppendTextOut (String &a, const FloatVector3 &b)
 
void Proud::AppendTextOut (String &a, const Vector3 &b)
 
template<typename K , typename V >
__forceinline CMessage & Proud::operator>> (CMessage &a, CFastMap< K, V > &b)
 
template<typename K , typename V >
__forceinline CMessage & Proud::operator<< (CMessage &a, const CFastMap< K, V > &b)
 
template<typename K , typename V >
__forceinline void Proud::AppendTextOut (String &a, const CFastMap< K, V > &b)
 
template<typename elem >
__forceinline CMessage & Proud::operator>> (CMessage &a, CFastList< elem > &b)
 
template<typename elem >
__forceinline CMessage & Proud::operator<< (CMessage &a, const CFastList< elem > &b)
 
template<typename elem >
__forceinline void Proud::AppendTextOut (String &a, const CFastList< elem > &b)
 
__forceinline CMessage & Proud::operator<< (CMessage &a, const ByteArrayPtr &b)
 
__forceinline CMessage & Proud::operator>> (CMessage &a, ByteArrayPtr &b)
 
__forceinline void Proud::AppendTextOut (String &a, const ByteArrayPtr &b)
 
template<typename elem >
String Proud::TestMarshaler (const elem &testee)
 

Variables

const int Proud::InvalidSocket = 0
 
PROUD_API const PNTCHAR * Proud::ProxyBadSignatureErrorText
 
const PNTCHAR * Proud::DecryptFailedError
 

Detailed Description

Please refer to ProudNet : Server and Network for description of this module.

Typedef Documentation

typedef RefCount<ErrorInfo> Proud::ErrorInfoPtr

Smart pointer of the object that contains error info

  • ErrorInfoPtr does not use fast alloc since it does not exist often

Enumeration Type Documentation

Compression mode

Enumerator
CM_None 

Do not compress

CM_Zip 

Compress with ZIP algorism

Connection status with other hosts

Enumerator
ConnectionState_Disconnected 

Disconnected condition

ConnectionState_Connecting 

Tried connecting but result is unknown

ConnectionState_Connected 

Succeed to connect

ConnectionState_Disconnecting 

Disconnecting is in progress

Conditions to start hole-punching for direct P2P communication among clients

Enumerator
DirectP2PStartCondition_Jit 

Unless really needed, it is recommended not to do hole-punching. Using this is strongly recommended.

DirectP2PStartCondition_Always 

This forcefully begins hole-punching at the moment when P2P communication among clients is allowed by CNetServer.CreateP2PGroup or CNetServer.JoinP2PGroup or others. For an example, if there is a need to change super peer at P2P Networking for Super Peer (Super Peer or host) during game play, this may be needed.

Setup value of encryption and decryption

Enumerator
EM_None 

Do not encrypt

EM_Secure 

Do encryption that mixture with RSA and AES. Do not use with secure message such as logon

EM_Fast 

Do encryption that mixture with RSA and Fast. Encryption is required like moving character but please consider about performance.

How to intentially use TCP fallback

Enumerator
FallbackMethod_None 

No Fallback. In other words, UDP communication to both server and peer are in use.

FallbackMethod_PeersUdpToTcp 

Regards that UDP with server is sustained but UDP with other peers to be disconnected. Reproduce a circumstance similar to a temporary port mapping failure. This is the lowest option with weakest impact.

FallbackMethod_ServerUdpToTcp 

Regards that UDP with server is disconnected. Reproduce a circumstance similar to a temporary port mapping failure. On top of that, it also disconnects UDP with peers. Intermediate impact.

FallbackMethod_CloseUdpSocket 

All UDP sockets of client will be shut down. UDP restoration will never be possible. Strongest impact.

Type of hacking

Enumerator
HackType_None 

No hacking

HackType_SpeedHack 

Speek hack

HackType_PacketRig 

Handle packet

ProudNet host identifier

Enumerator
HostID_None 

None

HostID_Server 

Server

HostID_Last 

(Do not use it)

It is a category type of the log occurred within the module.

Enumerator
LogCategory_System 

Basic System

LogCategory_Tcp 

Relevant to TCP communication

LogCategory_Udp 

Relevant to UDP communication

LogCategory_P2P 

Relevant to P2P communication

Message transmission priority. Refer to Prioritizing message transmission.

Enumerator
MessagePriority_High 

High priority

MessagePriority_Medium 

Medium priority. Used most frequently

MessagePriority_Low 

Low priority

Mini Dump Type

Enumerator
MiniDumpAction_None 

It is a general program.

MiniDumpAction_DoNothing 

In case of mini dump file creation by user calling.

MiniDumpAction_AlarmCrash 

In case of mini dump file creation by crash.

비동기 실행의 종류입니다.

Enumerator
RunAsyncType_Single 

1개의 스레드에서만 비동기 실행을 합니다.

RunAsyncType_Parallel 

모든 스레드에서 비동기 실행을 합니다. 예를 들어 thread pool 안에 스레드가 3개이면 각 스레드에서의 비동기 실행이 동시에 일어나서, 즉 3회의 비동기 실행이 됩니다.

This is a policy allocating UDP sockets to be used by the serverwhen communicating with the clients. Please refer Method of using Server UDP Port for more details.

Enumerator
ServerUdpAssignMode_None 

Not designated. Users are not to use this value.

ServerUdpAssignMode_PerClient 

For each clients that coonects, it is to use different UDP port for each of them.

ServerUdpAssignMode_Static 
    All the clients that connect reuse the UDP ports that are already prepared.
    When using this option, it is possible to cause some clients hard to communicate with the server due to UDP characteristics.
    - This is option is prepared for the lower compatibility of Proudnet and it is not recommended to use.
    - It is necessary to use a firewall setup to use this feature. Please refer <a target="_blank" href="http://guide.nettention.com/cpp_en#block_icmp" >Firewall setup for ICMP related

for more details. This value affects Proud.CStartServerParameter.m_udpPorts also.

Socket Error Code

Function Documentation

template<typename elem >
String Proud::TestMarshaler ( const elem &  testee)

It tests marshaler method that created by user. Please use it for debugging.

Parameters
testeeVariable type object that created by user. We recommend to put complex value for testing. This object time has to have Equals() method as member. It has return ture when Equals() method compare two value and if it is the same.
Returns
If there in no error, it will send an empty string. If there is error then return information of error. Example
MyType a;
a = ...; // Put something in
if(!err.IsEmpty())
show_error(err);