BedrockFramework | High performance , low level networking APIs | Networking library
kandi X-RAY | BedrockFramework Summary
kandi X-RAY | BedrockFramework Summary
High performance, low level networking APIs for building custom servers and clients.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of BedrockFramework
BedrockFramework Key Features
BedrockFramework Examples and Code Snippets
Community Discussions
Trending Discussions on BedrockFramework
QUESTION
I'm trying to create a pipe web socket client, which is going to pull data off exchanges. The code is something between David Fowler's BedrockFramework and @StephenCleary's TCP Chat. I'm not sure if there is a difference between IDuplexPipe
(David's way) and normal pipes (Stephen's way), I believe they are two ways to express same thing.
The question is how do I gracefully stop/close everything, i.e. basically I want to create a StopAsync
method? Side question, what is the reason that they don't use a CancellationToken
?
ANSWER
Answered 2022-Mar-14 at 23:47I haven't looked at David Fowler's framework in detail yet, but I would expect he uses the same completion semantics that mine does: when the output (socket writing) pipe completes, then the (web)socket is closed.
In your code, ProcessSendsAsync
will return when the pipeline is completed, and this will cause DoSendAsync
to call webSocket.Abort
. I assume you should modify DoSendAsync
to call CloseAsync
when the pipeline is completed without an exception, and only call Abort
when it there is an exception.
If you haven't seen it yet, this is the video where I discuss how I handle shutdowns, both exceptional and graceful.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install BedrockFramework
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page