This section introduces troubles you may experience as using ProudNet and how you can solve them.
11.1How to maintain the connection with server when the program stops due to debugger
Either server or client pauses operating almost instantly when the program under debugging reaches a break point or else. With ProudNet, the connection between server and client gets disconnected after tens of seconds of the program pause.
In normal circumstances, ProudNet immediately detects when the connection between hosts is lost abnormally. However, it can't detect hard disconnect such as pulling out a plug or internet line until packet is being exchanged between hosts. ProudNet also considers the pause of program under debugging for tens of seconds as hard disconnect. This is very normal behavior but it definitely irritates developer as creating a program.
To fix this problem, you can extend the detecting time of hard disconnect as long as you need it to be (let's say an hour?) using Proud.CNetServer.SetDefaultTimeoutTimeSec.
WARNING: We recommend you to use Proud.CNetServer.SetDefaultTimeoutTimeSec when only debugging. If Proud.CNetServer.SetDefaultTimeoutTimeSec is set for too much of delay and released to gamer as-is then it could take significantly long time for the game to detect hard disconnect. Sometimes there are gamers intentionally causing hard disconnect so please be aware of consequences of using this method.
Sample
Proud::CNetServer* srv = ...;
#ifdef _DEBUG
srv->SetDefaultTimeoutTimeSec(60*10); // 10 mintues
#endif
11.2A case of a build error
Do include <atlbase.h> before doing include <ProudNetServer.h> or include <ProudNetClietn.h>. It is also good to do #include <atlbase.h> in stdafx.h if you use stdafx.h.
There is a symbol called System.String for applications that use .Net Framework. However, ProudNet has a symbol called Proud.String. You may want to explicitly use the namespace System or Proud if you use .Net Framework and ProudNet together.
11.3When the connection comes back to life after few seconds of suddenly going dark in P2P communication
It takes few seconds for ProudNet to detect the connection loss of P2P communication. If there is anything that blocks P2P communication then ProudNet automatically switches P2P communication to relay mode. When this happens, all reliable messages that haven't been transmitted during the darkout time will be transmited at once but Unreliable Message will be lost.
11.4P2P communication suddenly doesn't work
The principal of ProudNet is to help P2P communication work at any circumstances by all means possible. If P2P communication doesn't work as using ProudNet, please contact our technical support immediately.
If this problem occurs as acutally servicing a game, then you can run the service in 'Safe Mode' temporarily as blocking all UDP communication. The method that allows to do this is Proud.CNetServer.SetDefaultFallbackMethod.
If you use the above method, Unreliable Message will relay to TCP in communication with server and perform P2P relay for P2P communication through TCP.
Please refer to 6. ProudNet Tips for performance enhancement.
11.5Blocking an Assert dialog box
If there is an inner error, ProudNet can display an assert failure dialog box. This is a natural thing.
If you want to block this dialog box, you should change you configuration to work the another routine than to display the assert failure dialog box. You can make the other routine. An example is below.
#include "stdafx.h" #include <crtdbg.h> int YourReportHook( int reportType, char *message, int *returnValue ) { return 1; } int _tmain(int argc, _TCHAR* argv[]) { _CrtSetReportHook(YourReportHook); assert(0); // now, this won't show you the message box. return 0; }
11.6When exception occurs related to CFastHeap or CLookasideAllocator
Including Proud.CNetServer and Proud.CNetClient, many internal objects of ProudNet use The internal link is invalid.. And it leaves The internal link is invalid. instance as C++ singleton. Because of this feature, if you leave instance of Proud.CNetServer, Proud.CNetClient, and etc. as global variable or member variable of global variable, it would most likely cause exception.
Thus instance has to be in C++ singleton instead of global variable. Instance created by C++ singleton guarantees to be destructed in accordance of object on dependency before WinMain() or main() returns.
11.7RMI Error occurs when message is too short.
The length of RMI message in ProudNet has its limitation. If any message exceeds the boundary of this limitation from where communication between servers (10. Communication between servers) or file transmission is required, then it most likely causes an error.
In order to fix this problem, the length limitation has to be reset. How you can do this is guided in 7. Limiting the size of communication message.
11.8If you can not exceed concurrent users more than 5,000
If you cannot allow concurrent users more than 5,000, please check as followed
CPU usage of server is too high?
Memory usage of server is too high?
Non paged pool usage of server is too high?
Network traffic of server is too high?
MaxUserPort(DWORD) parameter of HKEY_LOCAL_MACHINE is lower than 5000