Search found 275 matches

by tatanas
Thu Feb 05, 2026 10:34 am
Forum: The PureBasic Editor
Topic: Debug Output Text color
Replies: 6
Views: 762

Re: Debug Output Text color

Your idea is great too !
About my question, is this possible with an IDE-Tool or should it be included natively in PB ?
by tatanas
Wed Feb 04, 2026 2:45 pm
Forum: The PureBasic Editor
Topic: Debug Output Text color
Replies: 6
Views: 762

Debug Output Text color

Hi,

I would like to know if there is a IDE-Tool somewhere that can set a front/back color to the text added to the EditorGadget of the Debug Output window ?
I search a bit on the Purebasic github. I found some files like DebugOutput.pb and DebuggerCommon.pb where part of the interactions with this ...
by tatanas
Wed Feb 04, 2026 1:45 pm
Forum: Coding Questions
Topic: TCP Server (TLS) ReceiveNetworkData issue
Replies: 14
Views: 855

Re: TCP Server (TLS) ReceiveNetworkData issue

This time, I think I’ve found where the problem comes from. I’m using a heartbeat system to detect ghost connections. Clients regularly send a “PING” packet to let the server know they’re still alive. If the delay between two pings is exceeded, the server forces the client to disconnect. Here is the ...
by tatanas
Wed Feb 04, 2026 8:06 am
Forum: Coding Questions
Topic: TCP Server (TLS) ReceiveNetworkData issue
Replies: 14
Views: 855

Re: TCP Server (TLS) ReceiveNetworkData issue

Unfortunately, the bug is still present. The problem comes from somewhere else...

ReceiveNetworkData() is only used in the main thread, I don’t have any concurrent access.

And ReceiveNetworkDataEx() also returns more detailed reasons for a -1 result (look at *error.Integer=0)
*error returns #PB ...
by tatanas
Tue Feb 03, 2026 8:18 pm
Forum: Coding Questions
Topic: TCP Server (TLS) ReceiveNetworkData issue
Replies: 14
Views: 855

Re: TCP Server (TLS) ReceiveNetworkData issue

I ran a few tests by removing parts of the code to simplify things as much as possible.
I eventually noticed that after creating the “ProcessRequest()” thread, I hadn’t added any delay. From experience, I know that creating threads too quickly can cause issues. So I added a delay(5), and since then ...
by tatanas
Tue Feb 03, 2026 10:30 am
Forum: Coding Questions
Topic: TCP Server (TLS) ReceiveNetworkData issue
Replies: 14
Views: 855

Re: TCP Server (TLS) ReceiveNetworkData issue

ReceiveNetworkDataEx() by idle : https://www.purebasic.fr/english/viewtopic.php?t=86576

Normally I don't have packet > 65536 bytes.
How do you separate two packages that are received during one NetworkClientEvent() call I don't understand, if they are 2 packets during one call, they are stocked in ...
by tatanas
Tue Feb 03, 2026 10:02 am
Forum: Coding Questions
Topic: TCP Server (TLS) ReceiveNetworkData issue
Replies: 14
Views: 855

Re: TCP Server (TLS) ReceiveNetworkData issue

I will explain a bit better. The server run the NetworkserverEvent main loop in a thread : #PB_NetworkEvent_Connect, #PB_NetworkEvent_Data, and #PB_NetworkEvent_Disconnect. Indeed ReceiveNetworkData() is called inside #PB_NetworkEvent_Data case. All connections are still active when the problem ...
by tatanas
Tue Feb 03, 2026 9:06 am
Forum: Coding Questions
Topic: TCP Server (TLS) ReceiveNetworkData issue
Replies: 14
Views: 855

TCP Server (TLS) ReceiveNetworkData issue

Hello,

I'm encountering a really strange issue on the server side of my TCP client/server software.
The client is deployed on about 1,200 Windows 11 machines; they connect to the server as soon as they start up and disconnect when they shut down.

Until now, the server was running on Debian, but I ...
by tatanas
Thu Jan 29, 2026 7:59 am
Forum: Tricks 'n' Tips
Topic: atomic web server threads
Replies: 175
Views: 60471

Re: atomic web server threads

At the first start of the server there is no crash, SendNetworkString() return -1. But if you retry (stop/start the server), you should have a crash.
I'm not using TLS.
by tatanas
Wed Jan 28, 2026 9:49 am
Forum: Tricks 'n' Tips
Topic: atomic web server threads
Replies: 175
Views: 60471

Re: atomic web server threads

I didn't put any mutex in this example but I'm using them in my program.
A mutex for the SendNetworkString() is this example wouldn't fix the problem (there is only one Send and no competitive access).
by tatanas
Wed Jan 28, 2026 8:56 am
Forum: Tricks 'n' Tips
Topic: atomic web server threads
Replies: 175
Views: 60471

Re: atomic web server threads

I'm already using your "NetworkErrorContinue" procedure :D .
The crashes appear as soon as you put the network native functions outside the main network loop. When using threads (essential when dealing with a tcp server with a lot of clients which stay connected) if a deconnection occurs when a ...
by tatanas
Mon Jan 26, 2026 9:50 am
Forum: Tricks 'n' Tips
Topic: atomic web server threads
Replies: 175
Views: 60471

Re: atomic web server threads

Thank you very much, it works fine.
With this, I should be able to bypass the crash from native PB network procedures when the socket isn't valid anymore.
by tatanas
Thu Jan 22, 2026 8:20 pm
Forum: Tricks 'n' Tips
Topic: atomic web server threads
Replies: 175
Views: 60471

Re: atomic web server threads

Oh I see. Indeed I'm not using a web server so I didn't think about the domain part.
For this example I was using the private key/certificate code from Purebasic TLS server example but I tested with my own self signed .crt and .key files too and got the same error.

Thanks for your time.
by tatanas
Thu Jan 22, 2026 11:22 am
Forum: Tricks 'n' Tips
Topic: atomic web server threads
Replies: 175
Views: 60471

Re: atomic web server threads

Hi idle,

I'm testing a TLS client/server with your tlsStatic.pbi (yes I know that since PB 6.20, we can use native network procedures with TLS but crashes when client socket isn't valid anymore forces me to find another solution). I keep getting an error when the server receives data from a client ...
by tatanas
Mon Nov 17, 2025 2:22 pm
Forum: Coding Questions
Topic: Need help to stress test a tcp server memory usage
Replies: 1
Views: 450

Need help to stress test a tcp server memory usage

Hi,

I have developed a Windows server application that approximately 400 clients connect to simultaneously.
However, I believe there is a memory leak. Memory usage keeps increasing, even though it’s quite small (around 20 MB per day). I’ve checked threads, mutexes, memory allocation, JSON creation ...