Proud::CNetClient Class Referenceabstract

Network Client. More...

Inheritance diagram for Proud::CNetClient:

Public Member Functions

virtual bool Connect (const CNetConnectionParam &connectionInfo)=0
 
virtual bool Connect (const CNetConnectionParam &connectionInfo, ErrorInfoPtr &outError)=0
 
virtual void Disconnect ()=0
 
virtual void Disconnect (const CDisconnectArgs &args)=0
 
virtual void Disconnect (ErrorInfoPtr &outError)=0
 
virtual void Disconnect (const CDisconnectArgs &args, ErrorInfoPtr &outError)=0
 
virtual void DisconnectAsync (const CDisconnectArgs &args)=0
 
virtual void FrameMove (int maxWaitTime=0, CFrameMoveResult *outResult=NULL)=0
 
virtual void FrameMove (int maxWaitTime, CFrameMoveResult *outResult, ErrorInfoPtr &outError)=0
 
virtual void GetGroupMembers (HostID groupHostID, HostIDArray &output)=0
 
virtual int64_t GetIndirectServerTimeMs (HostID peerHostID)=0
 
virtual HostID GetLocalHostID ()=0
 
virtual String GetNatDeviceName ()=0
 
virtual void GetLocalJoinedP2PGroups (HostIDArray &output)=0
 
virtual void GetStats (CNetClientStats &outVal)=0
 
virtual int64_t GetP2PServerTimeMs (HostID groupHostID)=0
 
virtual AddrPort GetLocalUdpSocketAddr (HostID remotePeerID)=0
 
virtual bool GetDirectP2PInfo (HostID remotePeerID, CDirectP2PInfo &outInfo)=0
 
virtual AddrPort GetServerAddrPort ()=0
 
virtual bool GetPeerInfo (HostID peerHostID, CNetPeerInfo &output)=0
 
virtual bool SetHostTag (HostID hostID, void *hostTag)=0
 
virtual int64_t GetServerTimeMs ()=0
 
virtual int64_t GetServerTimeDiffMs ()=0
 
virtual ConnectionState GetServerConnectionState (CServerConnectionState &output)=0
 
virtual void GetWorkerState (CClientWorkerInfo &output)=0
 
bool HasServerConnection ()
 
virtual void SetEventSink (INetClientEvent *eventSink)=0
 
virtual INetClientEventGetEventSink ()=0
 
double GetLastUnreliablePingSec (HostID remoteHostID, ErrorType *error=NULL)
 
virtual int GetLastUnreliablePingMs (HostID remoteHostID, ErrorType *error=NULL)=0
 
virtual int GetLastReliablePingMs (HostID remoteHostID, ErrorType *error=NULL)=0
 
double GetLastReliablePingSec (HostID remoteHostID, ErrorType *error=NULL)
 
double GetRecentUnreliablePingSec (HostID remoteHostID, ErrorType *error=NULL)
 
virtual int GetRecentUnreliablePingMs (HostID remoteHostID, ErrorType *error=NULL)=0
 
virtual int GetRecentReliablePingMs (HostID remoteHostID, ErrorType *error=NULL)=0
 
double GetRecentReliablePingSec (HostID remoteHostID, ErrorType *error=NULL)
 
virtual ErrorType StartRoundTripLatencyTest (HostID peerID, const StartRoundTripLatencyTestParameter &parameter)=0
 
virtual ErrorType StopRoundTripLatencyTest (HostID peerID)=0
 
virtual ErrorType GetRoundTripLatency (HostID peerID, RoundTripLatencyTestResult &result)=0
 
virtual bool InvalidateUdpSocket (HostID peerID, CDirectP2PInfo &outDirectP2PInfo)=0
 
virtual bool RestoreUdpSocket (HostID peerID)=0
 
virtual void TEST_FallbackUdpToTcp (FallbackMethod mode)=0
 
virtual void TEST_EnableVirtualSpeedHack (int64_t multipliedSpeed)=0
 
virtual void TEST_SetPacketTruncatePercent (Proud::HostType hostType, int percent)=0
 
virtual bool GetPeerReliableUdpStats (HostID peerID, ReliableUdpHostStats &output)=0
 
virtual bool IsLocalHostBehindNat (bool &output)=0
 
virtual int GetInternalVersion ()=0
 
virtual int GetMessageMaxLength ()=0
 
virtual AddrPort GetPublicAddress ()=0
 
virtual void GetUserWorkerThreadInfo (CFastArray< CThreadInfo > &output)=0
 
virtual void GetNetWorkerThreadInfo (CFastArray< CThreadInfo > &output)=0
 
virtual bool GetSocketInfo (HostID remoteHostID, CSocketInfo &output)=0
 
virtual void SetApplicationHint (const CApplicationHint &hint)=0
 
virtual bool SendUserMessage (const HostID *remotes, int remoteCount, RmiContext &rmiContext, uint8_t *payload, int payloadLength)=0
 
bool SendUserMessage (HostID remote, RmiContext &rmiContext, uint8_t *payload, int payloadLength)
 
virtual ErrorType SetCoalesceIntervalMs (HostID remote, int intervalMs)=0
 
virtual ErrorType SetCoalesceIntervalToAuto (HostID remote)=0
 
virtual bool SendEmergencyLogData (String serverAddr, uint16_t serverPort)=0
 
virtual AddrPort GetTcpLocalAddr ()=0
 
virtual AddrPort GetUdpLocalAddr ()=0
 
virtual String TEST_GetDebugText ()=0
 
virtual void TEST_GetTestStats (CTestStats2 &output)=0
 
virtual void TEST_FakeTurnOffSendAndReceive ()=0
 
virtual void TEST_SetAutoConnectionRecoverySimulatedDelay (int timeMs)=0
 
virtual ErrorType ForceP2PRelay (HostID remotePeerID, bool enable)=0
 
virtual ErrorType GetUnreliableMessagingLossRatioPercent (HostID remotePeerID, int *outputPercent)=0
 
virtual void HolsterMoreCallbackUntilNextFrameMove ()=0
 
- Public Member Functions inherited from Proud::IRmiHost
virtual void AttachProxy (IRmiProxy *proxy)=0
 
void AttachProxy (IRmiProxy *proxy, ErrorInfoPtr &outError)
 
virtual void AttachStub (IRmiStub *stub)=0
 
void AttachStub (IRmiStub *stub, ErrorInfoPtr &outError)
 
virtual void DetachProxy (IRmiProxy *proxy)=0
 
void DetachProxy (IRmiProxy *proxy, ErrorInfoPtr &outError)
 
virtual void DetachStub (IRmiStub *stub)=0
 
void DetachStub (IRmiStub *stub, ErrorInfoPtr &outError)
 
virtual void SetTag (void *value)=0
 
virtual void * GetTag ()=0
 
virtual bool RunAsync (HostID taskOwner, LambdaBase_Param0< void > *func)=0
 
virtual bool IsSimplePacketMode ()=0
 
virtual void ShowError_NOCSLOCK (ErrorInfoPtr errorInfo)=0
 
virtual void ShowNotImplementedRmiWarning (const PNTCHAR *RMIName)=0
 
virtual void PostCheckReadMessage (CMessage &msg, const PNTCHAR *RMIName)=0
 
virtual CriticalSectionGetCriticalSection ()=0
 
- Public Member Functions inherited from Proud::IHlaHost_C
virtual void HlaAttachEntityTypes (CHlaEntityManagerBase_C *entityManager)=0
 
virtual void HlaSetDelegate (IHlaDelegate_C *dg)=0
 
virtual void HlaFrameMove ()=0
 

Static Public Member Functions

static CNetClientCreate ()
 

Public Attributes

LambdaBaseHolder_Param2< void,
ErrorInfo *, const ByteArray & > 
OnJoinServerComplete
 See Proud.INetClientEvent.OnJoinServerComplete for details.
 
LambdaBaseHolder_Param1< void,
ErrorInfo * > 
OnLeaveServer
 See Proud.INetClientEvent.OnLeaveServer for details.
 
LambdaBaseHolder_Param4< void,
HostID, HostID, int, const
ByteArray & > 
OnP2PMemberJoin
 See Proud.INetClientEvent.OnP2PMemberJoin for details.
 
LambdaBaseHolder_Param3< void,
HostID, HostID, int > 
OnP2PMemberLeave
 See Proud.INetClientEvent.OnP2PMemberLeave for details.
 
LambdaBaseHolder_Param2< void,
HostID, ErrorType > 
OnChangeP2PRelayState
 See Proud.INetClientEvent.OnChangeP2PRelayState for details.
 
LambdaBaseHolder_Param1< void,
ErrorType > 
OnChangeServerUdpState
 See Proud.INetClientEvent.OnChangeServerUdpState for details.
 
LambdaBaseHolder_Param1< void,
CRemoteOfflineEventArgs & > 
OnP2PMemberOffline
 See Proud.INetClientEvent.OnP2PMemberOffline for details.
 
LambdaBaseHolder_Param1< void,
CRemoteOnlineEventArgs & > 
OnP2PMemberOnline
 See Proud.INetClientEvent.OnP2PMemberOnline for details.
 
LambdaBaseHolder_Param1< void,
CRemoteOfflineEventArgs & > 
OnServerOffline
 See Proud.INetClientEvent.OnServerOffline for details.
 
LambdaBaseHolder_Param1< void,
CRemoteOnlineEventArgs & > 
OnServerOnline
 See Proud.INetClientEvent.OnServerOnline for details.
 
LambdaBaseHolder_Param0< void > OnSynchronizeServerTime
 See Proud.INetClientEvent.OnSynchronizeServerTime for details.
 
- Public Attributes inherited from Proud::HasCoreEventFunctionObjects
LambdaBaseHolder_Param1< void,
ErrorInfo * > 
OnError
 See Proud.INetCoreEvent.OnError for details.
 
LambdaBaseHolder_Param1< void,
const Exception & > 
OnException
 See Proud.INetCoreEvent.OnException for details.
 
LambdaBaseHolder_Param1< void,
ErrorInfo * > 
OnInformation
 See Proud.INetCoreEvent.OnInformation for details.
 
LambdaBaseHolder_Param1< void,
RmiID > 
OnNoRmiProcessed
 See Proud.INetCoreEvent.OnNoRmiProcessed for details.
 
LambdaBaseHolder_Param4< void,
HostID, const RmiContext
&, uint8_t *, int > 
OnReceiveUserMessage
 See Proud.INetCoreEvent.OnReceiveUserMessage for details.
 
LambdaBaseHolder_Param1< void,
ErrorInfo * > 
OnWarning
 See Proud.INetCoreEvent.OnWarning for details.
 
LambdaBaseHolder_Param1< void,
void * > 
OnTick
 See Proud.INetCoreEvent.OnTick for details.
 
LambdaBaseHolder_Param0< void > OnUserWorkerThreadCallbackBegin
 See Proud.INetCoreEvent.OnUserWorkerThreadCallbackBegin for details.
 
LambdaBaseHolder_Param0< void > OnUserWorkerThreadCallbackEnd
 See Proud.INetCoreEvent.OnUserWorkerThreadCallbackEnd for details.
 

Additional Inherited Members

- Protected Member Functions inherited from Proud::IRmiHost
virtual bool Send (const CSendFragRefs &sendData, const SendOpt &sendContext, const HostID *sendTo, int numberOfsendTo, int &compressedPayloadLength)=0
 

Detailed Description

Network Client.

A network client class for client-to-server networking and client-to-client (P2P) networking.

Network Client explains the details.

Member Function Documentation

virtual bool Proud::CNetClient::Connect ( const CNetConnectionParam connectionInfo)
pure virtual

Initialtes server connection request.

  • This function returns immediately. Being this function returned does not mean that the connection to server is completed.
  • It is possible to verify if connection to server is completed only after INetClientEvent.OnJoinServerComplete event arrives after calling this function.
Parameters
connectionInfospecifies server information to connect to.
Returns
Returns false is already connected to other server. Returns true if successfully connected.
static CNetClient* Proud::CNetClient::Create ( )
inlinestatic

Creates new instance.

virtual void Proud::CNetClient::Disconnect ( )
pure virtual

Terminates the connection to server and withdraws from all P2P group.

  • Please refer to same name method for more detail.
virtual void Proud::CNetClient::Disconnect ( const CDisconnectArgs args)
pure virtual

Terminates the connection to server and withdraws from all P2P group.

Parameters
gracefulDisconnectTimeoutClient requires a certain amount of time in order to process the steps to terminate the connection to server. This value is the maximum time(in second) that allowed to complete the termination. Usually 1 is reasonable for the value but if it is too small then there can be some cases that server cannot detect clinet's diconnection immediately after client terminated the connection.
commentThe data filled in here will be received at INetServerEvent.OnClientLeave. In other words, it is useful when client need to send its last data to server before terminating its connection to server.(e.g. sending why terminating the connection) If gracefulDisconnectTimeout is too short then there is a chance the sending fails.
virtual void Proud::CNetClient::Disconnect ( ErrorInfoPtr outError)
pure virtual

It disconnects the connection to the server. Additionally, it withdraws from all P2P groups. In an environment where try/catch cannot be used from the user side such as UE4/PS4, it shall be used when an error message is notified.

  • For details, refer to the method with the same name.
virtual void Proud::CNetClient::Disconnect ( const CDisconnectArgs args,
ErrorInfoPtr outError 
)
pure virtual

It disconnects the connection to the server. Additionally, it withdraws from all P2P groups. In an environment where try/catch cannot be used from the user side such as UE4/PS4, it shall be used when an error message is notified.

  • For details, refer to the method with the same name.
virtual ErrorType Proud::CNetClient::ForceP2PRelay ( HostID  remotePeerID,
bool  enable 
)
pure virtual

TODO:translate needed. This is the function to designate whether the communication with other P2P peers designated by the user should be forced to relay. The following are the cases where this feature comes handy.

  • When the P2P traffic from the client side is excessive so you want to convert some communication with some P2P peers to relay;
    Parameters
    remotePeerIDThe HostID value of the peer to be converted to relay
    enableIf true is enabled, forced relay is turned on.
virtual void Proud::CNetClient::FrameMove ( int  maxWaitTime = 0,
CFrameMoveResult outResult = NULL 
)
pure virtual

[Debugging] Leaves the status of entire P2P group as a dump

Handles received RMI or event All of RMI from server or callbcak event of INetClientEvent occurred since the last FrameMove call are stacked within memory. And those let callbacks happen by this method.

  • User is to call this periodically in order to handle RMI reception process and event occurred. Usually, user calls this method at every render frame.
  • By not calling this method for a long time does not cause the connection between server or other hosts terminated.
Parameters
maxWaitTimeMsIt is the value of how long it will wait until there is a processed event or in-coming message, If it is 0, do not wait and return immediately. 0 is general in the rendering loop including game, and etc. Put the appropriate value (for example, 200ms) in the general app without the rendering loop.
outResultGets the report to process result when FrameMove is called. Ignorable parameter.
virtual void Proud::CNetClient::FrameMove ( int  maxWaitTime,
CFrameMoveResult outResult,
ErrorInfoPtr outError 
)
pure virtual

No-throw function. Exception is stored to outError. Used for UE4, etc.

virtual bool Proud::CNetClient::GetDirectP2PInfo ( HostID  remotePeerID,
CDirectP2PInfo outInfo 
)
pure virtual

Gets the hole-punched information for this host to communicate with other peer that remotePeerID points

Parameters
remotePeerIDID of other peer
outInfowhere the hole-punching information for communicating with other peer to be filled
Returns
True if hole-punched peer, otherwise returns false. For the peer that is not hole-punched yet, there are some occasions that it returns true when calling this method in every 0.3 ~ 1 seconds. This happens since the moment when hole-punching is completed differs all the time.
virtual void Proud::CNetClient::GetGroupMembers ( HostID  groupHostID,
HostIDArray output 
)
pure virtual

Gets the HostID list of other peers participating groupHostID that is one of P2P groups that this client is participating

virtual int64_t Proud::CNetClient::GetIndirectServerTimeMs ( HostID  peerHostID)
pure virtual

Gets the server time that other peer has

virtual int Proud::CNetClient::GetInternalVersion ( )
pure virtual

Gets the version of engine protocol. If this value differes to engine protocol version from client then the connection will not be accepted.

virtual int Proud::CNetClient::GetLastReliablePingMs ( HostID  remoteHostID,
ErrorType *  error = NULL 
)
pure virtual

Gets the last latency of Remote peer. GetLastUnreliablePing value is found by Unreliable but the relevant function is measured by ReliableUdp.

Parameters
remoteHostIDHostID of remote peer to find. Gets the latency with server when set HostID_Server.
errorIt returns whether an error occurs or not. In case of normal case, ErrorType_Ok will be saved, however, ErrorType_ValueNotExist will be saved in case Ping is not received.
Returns
returns ping time(in millisecond). Returns -1 if there is none.
double Proud::CNetClient::GetLastReliablePingSec ( HostID  remoteHostID,
ErrorType *  error = NULL 
)
inline

Gets the last latency of Remote peer. GetLastUnreliablePing value is found by Unreliable but the relevant function is measured by ReliableUdp.

Parameters
remoteHostIDHostID of remote peer to find. Gets the latency with server when set HostID_Server.
errorIt returns whether an error occurs or not. In case of normal case, ErrorType_Ok will be saved, however, ErrorType_ValueNotExist will be saved in case Ping is not received.
Returns
returns ping time(in second). Returns -1 if there is none.
virtual int Proud::CNetClient::GetLastUnreliablePingMs ( HostID  remoteHostID,
ErrorType *  error = NULL 
)
pure virtual

Gets the last latency of Remote peer

Parameters
remoteHostIDHostID of remote peer to find. Gets the latency with server when set HostID_Server.
errorIt returns whether an error occurs or not. In case of normal case, ErrorType_Ok will be saved, however, ErrorType_ValueNotExist will be saved in case Ping is not received.
Returns
returns ping time(in millisecond). Returns -1 if there is none.
double Proud::CNetClient::GetLastUnreliablePingSec ( HostID  remoteHostID,
ErrorType *  error = NULL 
)
inline

Gets the last latency of Remote peer

Parameters
remoteHostIDHostID of remote peer to find. Gets the latency with server when set HostID_Server.
errorIt returns whether an error occurs or not. In case of normal case, ErrorType_Ok will be saved, however, ErrorType_ValueNotExist will be saved in case Ping is not received.
Returns
returns ping time(in second). Returns -1 if there is none.
virtual HostID Proud::CNetClient::GetLocalHostID ( )
pure virtual

Gets local HostID of this host. If HostID_None then means not connected to server

virtual void Proud::CNetClient::GetLocalJoinedP2PGroups ( HostIDArray output)
pure virtual

Gets the entire P2P group list that this host is participating

virtual AddrPort Proud::CNetClient::GetLocalUdpSocketAddr ( HostID  remotePeerID)
pure virtual

Gets the local address of UDP socket that this host has internally for communicating with other peer

Parameters
remotePeerIDHostID of other peer that P2P communicates with this host
Returns
CNetClient Port number or (address, port number) of UDP socket that is possessed internally. User can use this as port number.
  • This value can be AddrPort.Unassigned when the opponent peer entered P2P group recently. This is because ProudNet does not create UDP socket immediately for performance reason. So, if this happens then you must call this method again some moments later.
virtual int Proud::CNetClient::GetMessageMaxLength ( )
pure virtual

The maximum size of RMI or user defined message

virtual String Proud::CNetClient::GetNatDeviceName ( )
pure virtual

Gets the name of Internet router device(NAT device) that is active at the network that this client is participating.

virtual void Proud::CNetClient::GetNetWorkerThreadInfo ( CFastArray< CThreadInfo > &  output)
pure virtual

Gets the information of networking thread ProudNet has a thread that manages network I/O that is independent to Thread pool. This gets the information of the thread.

Parameters
outputThis is where the information is filled.
virtual int64_t Proud::CNetClient::GetP2PServerTimeMs ( HostID  groupHostID)
pure virtual

Gets server time of P2P group This is an average value of all GetIndirectServerTime() values within the P2P group that groupHostID points.

virtual bool Proud::CNetClient::GetPeerInfo ( HostID  peerHostID,
CNetPeerInfo output 
)
pure virtual

Gets the information of 1 peer connected to this object

Parameters
peerHostIDHostID of peer to find
outputthe information of peer found. Nothing will be filled when found nothing.
Returns
True means found
virtual bool Proud::CNetClient::GetPeerReliableUdpStats ( HostID  peerID,
ReliableUdpHostStats output 
)
pure virtual

Gets operation statistics of reliable messaging system among P2P

  • Used for performance test or debugging
virtual AddrPort Proud::CNetClient::GetPublicAddress ( )
pure virtual

Gets the network address of this client that is recognized by server. In other words, this is a public Internet address(external address).

  • Returns effective values only when connected to server
virtual int Proud::CNetClient::GetRecentReliablePingMs ( HostID  remoteHostID,
ErrorType *  error = NULL 
)
pure virtual

Gets the recent latency of Remote peer. GetRecentUnreliablePing value is found by Unreliable but the relevant function is measured by ReliableUdp.

Parameters
remoteHostIDHostID of remote peer to find. Gets the latency with server when set HostID_Server.
errorIt returns whether an error occurs or not. In case of normal case, ErrorType_Ok will be saved, however, ErrorType_ValueNotExist will be saved in case Ping is not received.
Returns
returns ping time(in millisecond). Returns -1 if there is none.
double Proud::CNetClient::GetRecentReliablePingSec ( HostID  remoteHostID,
ErrorType *  error = NULL 
)
inline

Gets the recent latency of Remote peer. GetRecentUnreliablePing value is found by Unreliable but the relevant function is measured by ReliableUdp.

Parameters
remoteHostIDHostID of remote peer to find. Gets the latency with server when set HostID_Server.
errorIt returns whether an error occurs or not. In case of normal case, ErrorType_Ok will be saved, however, ErrorType_ValueNotExist will be saved in case Ping is not received.
Returns
returns ping time(in second). Returns -1 if there is none.
virtual int Proud::CNetClient::GetRecentUnreliablePingMs ( HostID  remoteHostID,
ErrorType *  error = NULL 
)
pure virtual

Gets the recent latency of Remote peer

Parameters
remoteHostIDHostID of remote peer to find. Gets the latency with server when set HostID_Server.
errorIt returns whether an error occurs or not. In case of normal case, ErrorType_Ok will be saved, however, ErrorType_ValueNotExist will be saved in case Ping is not received.
Returns
returns ping time(in millisecond). Returns -1 if there is none.
double Proud::CNetClient::GetRecentUnreliablePingSec ( HostID  remoteHostID,
ErrorType *  error = NULL 
)
inline

Gets the recent latency of Remote peer

Parameters
remoteHostIDHostID of remote peer to find. Gets the latency with server when set HostID_Server. Gets the average latency of all members of P2P group when set HostID of P2P Group.
errorIt returns whether an error occurs or not. In case of normal case, ErrorType_Ok will be saved, however, ErrorType_ValueNotExist will be saved in case Ping is not received.
Returns
returns ping time(in second). Returns -1 if there is none.
virtual ErrorType Proud::CNetClient::GetRoundTripLatency ( HostID  peerID,
RoundTripLatencyTestResult result 
)
pure virtual
StartRoundTripLatencyTest 함수를 호출하고 원하는 시간이 흐른 뒤, 다음 두가지 방법으로 Roundtrip 레이턴시를 얻을 수 있다.

가지고 있는 최대 CNetConfig::RountTripLatencyTestMaxCount만큼의 레이턴시들로 측정 결과를 산출합니다. (1) 이 함수를 바로 호출하여 아웃파라미터로 Roundtrip 레이턴시 얻는다. (2) StopRoundTripLatencyTest 함수를 호출하여 측정을 끝낸뒤, 이 함수를 호출하여 아웃파라미터로 Roundtrip 레이턴시 얻는다. 구해진 Latency는 측정 시간 동안 오간 핑퐁들의 평균이다.

Parameters
peerIDRTT 테스트 타겟 피어의 HostID. HostID_Server를 넘기면 서버를 대상으로 한다.
result테스트 결과가 이 아웃파라미터에 담긴다.
Returns
성공하면 ErrorType_Ok, 등록되지 않은 피어이면 ErrorType_InvalidHostID를 반환한다.
virtual AddrPort Proud::CNetClient::GetServerAddrPort ( )
pure virtual

Gets the address of connected server

virtual ConnectionState Proud::CNetClient::GetServerConnectionState ( CServerConnectionState output)
pure virtual

Returns connection status to server

Parameters
outputwhere the status is filled
Returns
connection status to server
virtual int64_t Proud::CNetClient::GetServerTimeDiffMs ( )
pure virtual

Gets the time difference between client and server

virtual int64_t Proud::CNetClient::GetServerTimeMs ( )
pure virtual

Gets current time of server (in second) This value is the server time that considered periodic latency

virtual bool Proud::CNetClient::GetSocketInfo ( HostID  remoteHostID,
CSocketInfo output 
)
pure virtual

Gets socket handles that made by ProudNet. This function is useful when it need at security software(e.g. nProtect or Ahnlab Hack Shield) Please use socket handle from this method for getting information. Do not excute I/O process. Because it may occur bed reaction.

Parameters
remoteHostIDHostID of peer that getting socket information. If it is HostID_Server then it gets socket information from connected server.
outputInformation fill in here
Returns
remoteHostID It is true, if value is available.
virtual void Proud::CNetClient::GetStats ( CNetClientStats outVal)
pure virtual

Gets the statistics of process collected since beginning

virtual ErrorType Proud::CNetClient::GetUnreliableMessagingLossRatioPercent ( HostID  remotePeerID,
int *  outputPercent 
)
pure virtual

TODO:translate needed. As unreliable messaging takes most of the entire traffic in common on-line games, we add the feature to get the traffic loss rate in the existing unreliable messaging feature. Packet loss rate measuring device

Parameters
remoteHostIDWhich loss rate with communication with which remote would be obtained. You can input anything, including your own peer, server, etc. If it is itself, it is 0%
outputPercentThe packet loss rate is filled up in % unit (i.e., 0 to 100)
virtual void Proud::CNetClient::GetUserWorkerThreadInfo ( CFastArray< CThreadInfo > &  output)
pure virtual

Gets the information of each thread of Thread pool

Parameters
outputthis is where the information has filled in.
bool Proud::CNetClient::HasServerConnection ( )
inline

Return connect socket to server or not.

  • Only return connected socket to server or not.
virtual void Proud::CNetClient::HolsterMoreCallbackUntilNextFrameMove ( )
pure virtual

When CNetClient.FrameMove is called, all accumulated events and reception RMIs get called at the same time. ProudNet allows its user to abort the operation of accumulated events and reception RMIs being managed within one time called CNetClient.FrameMove and return in the middle.And the remaining events and reception RMIs can be managed by CNetClient.FrameMove call. When you even wish to stop the operation of remaining events or reception RMIs, you can call either Proud.INetClientEvent.HolsterMoreCallbackUntilNextFrameMove from the routine managing RMI reception or event reception.

DEFRMI_TestS2C_Foo(CMyClient)
{
...
// CNetClient.FrameMove ignores the remaining accumulated events and reception RMIs then returns immediately.
}
void CMyClient::OnClientLeave(...)
{
...
// When you call this, CNetClient.FrameMove ignores the remaining accumulated events and reception RMIs then returns immediately
}
virtual bool Proud::CNetClient::InvalidateUdpSocket ( HostID  peerID,
CDirectP2PInfo outDirectP2PInfo 
)
pure virtual

Shuts UDP socket that is possessed internally then forcefully converts server and P2P communication to bypass state

Parameters
peerIDHostId of opponent peer that to be forcefully bypassed
outDirectP2PInfowhere the hole-punching information that was possessed by CNetClient in order to perform P2P communication between this CNetClient and forcefully bypassed peer.
Returns
Returns true either if hole-punched with opponent peer while opponent peer exists OR sustained direct P2P.
virtual bool Proud::CNetClient::IsLocalHostBehindNat ( bool &  output)
pure virtual

Is this client behind a router?

Returns
returns false if cannot be verified. The output will not be filled at this time.
Parameters
outputFills true if the client is behind a router
virtual bool Proud::CNetClient::RestoreUdpSocket ( HostID  peerID)
pure virtual

Re-creates UDP socket removed by InvalidateUdpSocket And re-starts UDP hole-punching with opponent peer

Parameters
peerIDID of peer that InvalidateUdpSocket was executed previously.
Returns
true if successfully completed. False if there is no opponent peer.
virtual bool Proud::CNetClient::SendEmergencyLogData ( String  serverAddr,
uint16_t  serverPort 
)
pure virtual

TODO:translate needed. The emergency log is transmitted to the emergency log collection server (CEmergencyLogServer). You have to run CEmergencyLogServer first in order to use its feature.

  • You have to designate the number of CStartServerParameter.m_clientEmergencyLogMaxLineCount.
  • When the connection to the server is lost unintentionally, the current status log as well as the latest status of the client is transmitted to CEmergencyLogServer.
  • logClient generates a new thread inside and create a log client and the log is directly transmitted to the server. Therefore, you must not end the main thread after calling this method.
    Parameters
    serverAddrThis is the address of the log server.
    serverPortThis is the port number of the log server.
    Returns
    This is either success or failure. The case when the value of m_clientEmergencyLogMaxLineCount is 0 falls under this case.
virtual bool Proud::CNetClient::SendUserMessage ( const HostID remotes,
int  remoteCount,
RmiContext rmiContext,
uint8_t *  payload,
int  payloadLength 
)
pure virtual
    Send user defined message. Please refer to <a target="_blank" href="http://guide.nettention.com/cpp_en#send_user_message" >Exchanging user-defined message without using RMI at all</a> for more detail
Parameters
remotesReceiver array. You can put client, server(HostID_Server), P2P Group, etc like RMI.
remoteCountSize of receiver array
rmiContextAdditional information of sending. Please refer to Protocol type of ProudNet
payloadMessage data for sending.
payloadLengthLength of sending message data. It is byte.
bool Proud::CNetClient::SendUserMessage ( HostID  remote,
RmiContext rmiContext,
uint8_t *  payload,
int  payloadLength 
)
inline

Sending user defined message. Please refer to Exchanging user-defined message without using RMI at all for more detail.

Parameters
remotereceiver
rmiContextAdditional information of sending. Please refer to Protocol type of ProudNet.
payloadMessage data for sending.
payloadLengthLength of sending message data. It is byte.
virtual void Proud::CNetClient::SetApplicationHint ( const CApplicationHint hint)
pure virtual

Passes the status of application program that uses CNetClient to CNetClient User must measure the frame rate of the game that runs CNetClient in diffrent thread to rendering loop since it cannot be acquired directly by CNetClient.

virtual ErrorType Proud::CNetClient::SetCoalesceIntervalMs ( HostID  remote,
int  intervalMs 
)
pure virtual

Manually set coalesce interval. Use this function if you do not satisfy to the quality of coalesce feature of ProudNet. Inapprpriate use of this function may cause unexpected behavior, so care must be taken.

virtual ErrorType Proud::CNetClient::SetCoalesceIntervalToAuto ( HostID  remote)
pure virtual

Coalesce interval set to automatic. This is default.

virtual void Proud::CNetClient::SetEventSink ( INetClientEvent eventSink)
pure virtual

Sets the object can receive event

  • Only 1 object can be set.
  • This method can only be called before client attempts to connect to server. Otherwise, an execption will be 'throw'.
virtual bool Proud::CNetClient::SetHostTag ( HostID  hostID,
void *  hostTag 
)
pure virtual

Desigantes tag to each of other hosts(client for server, peer for client) aht are connected to this host. A User-defined data(Tag) for each host function.

  • Can designate tag to itself (server or client)
virtual ErrorType Proud::CNetClient::StartRoundTripLatencyTest ( HostID  peerID,
const StartRoundTripLatencyTestParameter parameter 
)
pure virtual
사용자 지정 주기로 핑퐁을 보내어 Roundtrip 레이턴시를 구하는 측정을 시작합니다.

최근 레이턴시 값들을 최대 CNetConfig::RountTripLatencyTestMaxCount만큼 가지고 있게 됩니다. 이 함수를 호출하고 원하는 시간이 흐른 뒤, 다음 두가지 방법으로 Roundtrip 레이턴시를 얻을 수 있습니다. (1) GetRoundTripLatency를 호출하여 아웃파라미터로 Roundtrip 레이턴시 얻습니다. (2) StopRoundTripLatencyTest를 호출하여 측정을 끝낸뒤, GetRoundTripLatency를 호출하여 아웃파라미터로 Roundtrip 레이턴시를 얻습니다. 구해진 Latency는 측정 시간 동안 오간 핑퐁들의 평균입니다.

Parameters
peerIDRTT 테스트 타겟 피어의 HostID.
parameter테스트가 어떻게 이루어지게 할 것인지에 대한 설정값들을 이 구조체에 담아보낸다.
Returns
성공하면 ErrorType_Ok, 등록되지 않은 피어이면 ErrorType_InvalidHostID를 반환한다.
virtual ErrorType Proud::CNetClient::StopRoundTripLatencyTest ( HostID  peerID)
pure virtual
사용자 지정 주기로 핑퐁을 보내어 Roundtrip 레이턴시를 구하는 측정을 끝낸다.

최근 레이턴시 값들을 최대 CNetConfig::RountTripLatencyTestMaxCount만큼 가지고 있게 됩니다. StartRoundTripLatencyTest 함수를 호출하고 원하는 시간이 흐른 뒤, 다음 두가지 방법으로 Roundtrip 레이턴시를 얻을 수 있다. (1) GetRoundTripLatency를 호출하여 아웃파라미터로 Roundtrip 레이턴시 얻는다. (2) 이 함수를 호출하여 측정을 끝낸뒤, GetRoundTripLatency를 호출하여 아웃파라미터로 Roundtrip 레이턴시 얻는다. 구해진 Latency는 측정 시간 동안 오간 핑퐁들의 평균이다.

Parameters
peerIDRTT 테스트 타겟 피어의 HostID. HostID_Server를 넘기면 서버를 대상으로 한다.
Returns
성공하면 ErrorType_Ok, 등록되지 않은 피어이면 ErrorType_InvalidHostID를 반환한다.