Replies: 7 comments 7 replies
-
is it always failing after a specific number of calls? If yes, most likely something that needs to be disposed and is not disposed. |
Beta Was this translation helpful? Give feedback.
-
Yes, about five or seven times. I think it's because of this problem, but I haven't solved it after looking for it for a long time😞
…---Original---
From: "Laurent ***@***.***>
Date: Tue, Jun 3, 2025 23:18 PM
To: ***@***.***>;
Cc: ***@***.******@***.***>;
Subject: Re: [nanoframework/Home] WebSocket Unidirectional Push Fails AfterSeveral Messages (Discussion #1643)
is it always failing after a specific number of calls?
If yes, most likely something that needs to be disposed and is not disposed.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
A web socket assumes a permanent connection with a client established according to certain rules. Tell us in more detail, how do you establish a connection in postman? I strongly suspect that the connection closes very quickly from the client side or the web socket server cannot process the connection request correctly. |
Beta Was this translation helpful? Give feedback.
-
@0use-TE Please show the headers tab on the request submission screen.
Try increasing the MaxClients to 3 in your code and retest.
And count the number of times you will be able to send a new request. If the number increases before the error, it means that the postman creates new connections for some reason. |
Beta Was this translation helpful? Give feedback.
-
@RelaxSpirit To prevent it from being my operational problem, I will record the entire process later |
Beta Was this translation helpful? Give feedback.
-
@0use-TE
And accordingly, web socket clients are added from different streams twice. From your code
And directly from the code of the library itself:
And from different threads. *Although I missed that you have IsStandAlone = false, which means that the second listener should not be started. Or maybe it's just that Postman doesn't respond to pings? Therefore, the connection via KeepAliveInterval is closed by the server. *And please excuse me if I can't express myself very clearly, English is not my native language and I know it very poorly :) |
Beta Was this translation helpful? Give feedback.
-
For good measure, in the code of the WebSocketClientsPool class need another check. Something like that:
In this case, customers exceeding the limit should receive an error. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I encountered an issue while using the nanoFramework WebSocket library. Every time the client sends about 5 requests, an error occurs.
Development Environment:
Reproduction Steps:
Since the code is a bit long, you can check out the repository here:
[loTCar/Src/loTCar/LowerComputer at main · 0use-TE/loTCar](https://github.com/0use-TE/loTCar/tree/main/Src/loTCar/LowerComputer)
The
program
sets up a hosted server.Here I registered the motor service and started a Web server, which checks prefixes and request headers to convert HTTP requests to WebSocket.
The key part below is where the exception occurs:
Next, I begin debugging.
Everything works fine at first:


Then I use Postman to send data:
Stack Trace:

I've been debugging this for quite a while but still haven't found the cause.
Please help me!
Beta Was this translation helpful? Give feedback.
All reactions