> For the complete documentation index, see [llms.txt](https://docs.proudnet.com/proudnet.eng/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.proudnet.com/proudnet.eng/proudnet-note/notes/how_to_solve_problems.md).

# What to do in case of an error

## Troubleshooting server disconnections when paused by the debugger

While you are using a debugger to debug a server or client, the program you are debugging is often paused due to breakpoint settings, etc.

However, with ProudNet, after tens of seconds of this pause, the connection between the server and the client is lost. If the connection between hosts is abnormally disconnected, it is generally detected immediately, but if a hard disconnect is performed, such as by forcibly disconnecting the power or communication line of the host, it is not immediately detected.

And hard disconnect is detected through ping-pong packets exchanged between hosts at regular intervals. Even if the program being debugged is paused for tens of seconds, ProudNet recognizes it as a hard disconnect and disconnects the host.

To solve this, use <mark style="color:orange;">Proud.CNetServer.SetDefaultTimeoutTimeSec</mark> to set the time to detect a hard disconnect sufficiently long (for example, one hour).

{% hint style="warning" %}
Setting <mark style="color:orange;">Proud.CNetServer.SetDefaultTimeoutTimeSec</mark> to a long time is only recommended when debugging.

If you set <mark style="color:orange;">SetDefaultTimeoutTimeSec</mark> to be long for versions that are distributed to gamers, it may take too long to detect disconnections from gamers who disconnect hard.

Please be aware that some gamers may abuse hard disconnect, so please be careful.
{% endhint %}

{% tabs %}
{% tab title="C++" %}

```cpp
// Example

Proud::CNetServer* srv = ...;
#ifdef _DEBUG
srv->SetDefaultTimeoutTimeSec(60*10); // 10 minutes
#endif
```

{% endtab %}

{% tab title="C#" %}

```csharp
// Example
Nettention.Proud.NetServer.SetDefaultTimeoutTimeMs


```

{% endtab %}
{% endtabs %}

## When a build error occurs

Please try <mark style="color:orange;">#include \<atlbase.h></mark> before <mark style="color:orange;">include \<ProudNetServer.h></mark> or <mark style="color:orange;">include \<ProudNetClietn.h></mark>. When using <mark style="color:orange;">stdafx.h</mark>, it is recommended to put <mark style="color:orange;">include \<atlbase.h></mark> at the beginning of <mark style="color:orange;">stdafx.h</mark>.

Programs using the <mark style="color:orange;">.Net Framework</mark> have the symbol System.String, but ProudNet has the symbol <mark style="color:orange;">Proud.String</mark>. Therefore, when mixing <mark style="color:orange;">.Net Framework</mark>, the symbol String may need to specify the namespace of either System or Proud.

## When P2P communication suddenly stops and communication resumes a few seconds later

ProudNet takes a few seconds to detect when a P2P connection is blocked in the middle of a P2P communication.

If it determines that the P2P connection is stuck in the middle, it will put the P2P connection into bypass mode. [**Reliable messages**](/proudnet.eng/proudnet-note/dictionary.md#reliable-messaging) are sent and received all at once, and [**Unreliable messages**](/proudnet.eng/proudnet-note/dictionary.md#unreliable-messaging) are lost.

## Blocking the Assert dialog box

ProudNet may display an assert failure dialog when there is an incorrect usage during internal operations in the debug build. If you want to prevent this, you should set something else to work instead of displaying the dialog when assert failure occurs.

You can also replace them with your own functions. An example is shown below.

{% tabs %}
{% tab title="C++" %}

```cpp
#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;
}
```

{% endtab %}
{% endtabs %}

## How to resolve exceptions related to CFastHeap or CLookasideAllocator

The <mark style="color:orange;">Server, Client</mark>, as well as many internal objects in ProudNet use [**Fast Heap**](/proudnet.eng/proudnet-note/dictionary.md#fast-heap), which leaves the instance as a [**C++ singleton**](/proudnet.eng/proudnet-note/dictionary.md#c-singleton).\
If an instance of a <mark style="color:orange;">Server</mark>, <mark style="color:orange;">Client</mark>, etc. that uses Fast Heap is placed as a global variable or a member variable of a global variable, an exception will occur.

Instances created with  <mark style="color:orange;">C++ singleton</mark> should be set to <mark style="color:orange;">C++ singleton</mark> rather than global variables because they ensure that <mark style="color:orange;">WinMain()</mark> or <mark style="color:orange;">main()</mark> is destroyed in line with the dependent object relationship before it returns.

## When the maximum number of concurrent users does not exceed 5,000

If you are not getting the maximum 5,000 concurrent users, you can check the following.

* [x] Is your server's CPU usage too high?
* [x] Is your server's memory usage too high?
* [x] Is your server's Non paged pool usage too high?
* [x] Is the network traffic on your server excessively high?
* [x] Is the value of <mark style="color:orange;">MaxUserPort(DWORD)</mark> in <mark style="color:orange;">HKEY\_LOCAL\_MACHINE</mark> 5,000 or less?

## If the ProudNetClientPlugin.dll module is not found

If the redistribution package is not installed, an error may occur even if the library exists in the path.

You can install the redistributions and CMake in the last step of the initial ProudNet installation, and after installation, the redistributions are also included in the Bin folder under the ProudNet installation path, so you can install them from there.

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.proudnet.com/proudnet.eng/proudnet-note/notes/how_to_solve_problems.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
