Strange webscoket error on server side

Godot Version

Godot 3.4 - 3.x+

Question

In my html5 game, on the server side, sometimes the error mbedtls_ssl_flush_output() returned -26752 (-0x6880) occurs.
Thousands of console notifications about this error. Also sometimes mbedtls_ssl_write_record() returned -26752 (-0x6880).
However, the game works fine. Who knows what this error is? What are its consequences? And how to fix it?

Hi.
Tracking down this error, this is “MBEDTLS_ERR_SSL_WANT_WRITE” defined like this …
#define MBEDTLS_ERR_SSL_WANT_WRITE -0x6880 /**< Connection requires a write call. */

This is the only post on the net what i come up with on a search …

Doesn’t seem to be critical, i sounds this error pops up if you try to read the socket but its blocked (or buffer empty?) then fails but tries again next time.

Thanks for the answer!
Have you ever encountered such an error
ERROR: Condition “p_base.is_null()” is true. Returned: ERR_INVALID_PARAMETER
at: accept_stream (modules/mbedtls/stream_peer_mbedtls.cpp:128).
The fact is that in the north the load on RAM and CPU is constantly growing. At an unexpected moment it turns off (about 2 days of normal operation). The console prints these errors.

Hmmm, without a proper stack trace this is hard to guess. This must have happen when calling accept_stream without a valid stream_peer.
The constantly rising ram points to a memory leak. Stream_peer is refcounted and should be garbaged automaticly. But if you use threaded networking this may lead to a growing number of failed network threads wich then eats up ram and cpu.

Dont know … maybe you should analyse your code again. Maybe you want to implement a more detailed tracking of your peers, when they are created and when released.

Threaded networking? I use standard web socket settings. How can I get the full list of stream_peers or clear them manually? Broken peer.
A server with 7-24 players works fine. 100+ players causes this problem.

Maybe you want to implement notification into your strem peers. You can then track the existence of the peers by counting them on initialize and delete. Keeping track if some peers get orphaned … even if its not possible because they are refcounted.

void _notification(what: int) virtual

Called when the object receives a notification, which can be identified in what by comparing it with a constant. See also notification.

func _notification(what):
if what == NOTIFICATION_PREDELETE:
print(“Goodbye!”)

Note: The base Object defines a few notifications (NOTIFICATION_POSTINITIALIZE and NOTIFICATION_PREDELETE). Inheriting classes such as Node define a lot more notifications, which are also received by this method.

The editors monitor has a oprphaned objects monitor, this yould help to find the meory leak.

Thanks for your help!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.