Network Client. More...
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 INetClientEvent * | GetEventSink ()=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 ¶meter)=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 | RunAsyncInternal (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 CriticalSection & | GetCriticalSection ()=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 CNetClient * | Create () |
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 |
Network Client.
A network client class for client-to-server networking and client-to-client (P2P) networking.
Network Client explains the details.
|
pure virtual |
Initialtes server connection request.
connectionInfo | specifies server information to connect to. |
|
inlinestatic |
Creates new instance.
|
pure virtual |
Terminates the connection to server and withdraws from all P2P group.
|
pure virtual |
Terminates the connection to server and withdraws from all P2P group.
gracefulDisconnectTimeout | Client 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. |
comment | The 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. |
|
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.
|
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.
|
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.
remotePeerID | The HostID value of the peer to be converted to relay |
enable | If true is enabled, forced relay is turned on. |
|
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.
maxWaitTimeMs | It 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. |
outResult | Gets the report to process result when FrameMove is called. Ignorable parameter. |
|
pure virtual |
No-throw function. Exception is stored to outError. Used for UE4, etc.
|
pure virtual |
Gets the hole-punched information for this host to communicate with other peer that remotePeerID points
remotePeerID | ID of other peer |
outInfo | where the hole-punching information for communicating with other peer to be filled |
|
pure virtual |
Gets the HostID list of other peers participating groupHostID that is one of P2P groups that this client is participating
|
pure virtual |
Gets the server time that other peer has
|
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.
|
pure virtual |
Gets the last latency of Remote peer. GetLastUnreliablePing value is found by Unreliable but the relevant function is measured by ReliableUdp.
remoteHostID | HostID of remote peer to find. Gets the latency with server when set HostID_Server. |
error | It 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. |
|
inline |
Gets the last latency of Remote peer. GetLastUnreliablePing value is found by Unreliable but the relevant function is measured by ReliableUdp.
remoteHostID | HostID of remote peer to find. Gets the latency with server when set HostID_Server. |
error | It 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. |
|
pure virtual |
Gets the last latency of Remote peer
remoteHostID | HostID of remote peer to find. Gets the latency with server when set HostID_Server. |
error | It 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. |
|
inline |
Gets the last latency of Remote peer
remoteHostID | HostID of remote peer to find. Gets the latency with server when set HostID_Server. |
error | It 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. |
|
pure virtual |
Gets local HostID of this host. If HostID_None then means not connected to server
|
pure virtual |
Gets the entire P2P group list that this host is participating
Gets the local address of UDP socket that this host has internally for communicating with other peer
remotePeerID | HostID of other peer that P2P communicates with this host |
|
pure virtual |
The maximum size of RMI or user defined message
|
pure virtual |
Gets the name of Internet router device(NAT device) that is active at the network that this client is participating.
|
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.
output | This is where the information is filled. |
|
pure virtual |
Gets server time of P2P group This is an average value of all GetIndirectServerTime() values within the P2P group that groupHostID points.
|
pure virtual |
Gets the information of 1 peer connected to this object
peerHostID | HostID of peer to find |
output | the information of peer found. Nothing will be filled when found nothing. |
|
pure virtual |
Gets operation statistics of reliable messaging system among P2P
|
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).
|
pure virtual |
Gets the recent latency of Remote peer. GetRecentUnreliablePing value is found by Unreliable but the relevant function is measured by ReliableUdp.
remoteHostID | HostID of remote peer to find. Gets the latency with server when set HostID_Server. |
error | It 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. |
|
inline |
Gets the recent latency of Remote peer. GetRecentUnreliablePing value is found by Unreliable but the relevant function is measured by ReliableUdp.
remoteHostID | HostID of remote peer to find. Gets the latency with server when set HostID_Server. |
error | It 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. |
|
pure virtual |
Gets the recent latency of Remote peer
remoteHostID | HostID of remote peer to find. Gets the latency with server when set HostID_Server. |
error | It 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. |
|
inline |
Gets the recent latency of Remote peer
remoteHostID | HostID 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. |
error | It 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. |
|
pure virtual |
StartRoundTripLatencyTest 함수를 호출하고 원하는 시간이 흐른 뒤, 다음 두가지 방법으로 Roundtrip 레이턴시를 얻을 수 있다.
가지고 있는 최대 CNetConfig::RountTripLatencyTestMaxCount만큼의 레이턴시들로 측정 결과를 산출합니다. (1) 이 함수를 바로 호출하여 아웃파라미터로 Roundtrip 레이턴시 얻는다. (2) StopRoundTripLatencyTest 함수를 호출하여 측정을 끝낸뒤, 이 함수를 호출하여 아웃파라미터로 Roundtrip 레이턴시 얻는다. 구해진 Latency는 측정 시간 동안 오간 핑퐁들의 평균이다.
peerID | RTT 테스트 타겟 피어의 HostID. HostID_Server를 넘기면 서버를 대상으로 한다. |
result | 테스트 결과가 이 아웃파라미터에 담긴다. |
|
pure virtual |
Gets the address of connected server
|
pure virtual |
Returns connection status to server
output | where the status is filled |
|
pure virtual |
Gets the time difference between client and server
|
pure virtual |
Gets current time of server (in second) This value is the server time that considered periodic latency
|
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.
remoteHostID | HostID of peer that getting socket information. If it is HostID_Server then it gets socket information from connected server. |
output | Information fill in here |
|
pure virtual |
Gets the statistics of process collected since beginning
|
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
remoteHostID | Which 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% |
outputPercent | The packet loss rate is filled up in % unit (i.e., 0 to 100) |
|
pure virtual |
Gets the information of each thread of Thread pool
output | this is where the information has filled in. |
|
inline |
Return connect socket to server or not.
|
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.
|
pure virtual |
Shuts UDP socket that is possessed internally then forcefully converts server and P2P communication to bypass state
peerID | HostId of opponent peer that to be forcefully bypassed |
outDirectP2PInfo | where the hole-punching information that was possessed by CNetClient in order to perform P2P communication between this CNetClient and forcefully bypassed peer. |
|
pure virtual |
Is this client behind a router?
output | Fills true if the client is behind a router |
|
pure virtual |
Re-creates UDP socket removed by InvalidateUdpSocket And re-starts UDP hole-punching with opponent peer
peerID | ID of peer that InvalidateUdpSocket was executed previously. |
|
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.
serverAddr | This is the address of the log server. |
serverPort | This is the port number of the log server. |
|
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
remotes | Receiver array. You can put client, server(HostID_Server), P2P Group, etc like RMI. |
remoteCount | Size of receiver array |
rmiContext | Additional information of sending. Please refer to Protocol type of ProudNet |
payload | Message data for sending. |
payloadLength | Length of sending message data. It is byte. |
|
inline |
Sending user defined message. Please refer to Exchanging user-defined message without using RMI at all for more detail.
remote | receiver |
rmiContext | Additional information of sending. Please refer to Protocol type of ProudNet. |
payload | Message data for sending. |
payloadLength | Length of sending message data. It is byte. |
|
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.
|
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.
|
pure virtual |
Coalesce interval set to automatic. This is default.
|
pure virtual |
Sets the object can receive event
|
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.
|
pure virtual |
사용자 지정 주기로 핑퐁을 보내어 Roundtrip 레이턴시를 구하는 측정을 시작합니다.
최근 레이턴시 값들을 최대 CNetConfig::RountTripLatencyTestMaxCount만큼 가지고 있게 됩니다. 이 함수를 호출하고 원하는 시간이 흐른 뒤, 다음 두가지 방법으로 Roundtrip 레이턴시를 얻을 수 있습니다. (1) GetRoundTripLatency를 호출하여 아웃파라미터로 Roundtrip 레이턴시 얻습니다. (2) StopRoundTripLatencyTest를 호출하여 측정을 끝낸뒤, GetRoundTripLatency를 호출하여 아웃파라미터로 Roundtrip 레이턴시를 얻습니다. 구해진 Latency는 측정 시간 동안 오간 핑퐁들의 평균입니다.
peerID | RTT 테스트 타겟 피어의 HostID. |
parameter | 테스트가 어떻게 이루어지게 할 것인지에 대한 설정값들을 이 구조체에 담아보낸다. |
|
pure virtual |
사용자 지정 주기로 핑퐁을 보내어 Roundtrip 레이턴시를 구하는 측정을 끝낸다.
최근 레이턴시 값들을 최대 CNetConfig::RountTripLatencyTestMaxCount만큼 가지고 있게 됩니다. StartRoundTripLatencyTest 함수를 호출하고 원하는 시간이 흐른 뒤, 다음 두가지 방법으로 Roundtrip 레이턴시를 얻을 수 있다. (1) GetRoundTripLatency를 호출하여 아웃파라미터로 Roundtrip 레이턴시 얻는다. (2) 이 함수를 호출하여 측정을 끝낸뒤, GetRoundTripLatency를 호출하여 아웃파라미터로 Roundtrip 레이턴시 얻는다. 구해진 Latency는 측정 시간 동안 오간 핑퐁들의 평균이다.
peerID | RTT 테스트 타겟 피어의 HostID. HostID_Server를 넘기면 서버를 대상으로 한다. |