Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libwebsockets
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Fork
libwebsockets
Commits
099f789d
Commit
099f789d
authored
12 years ago
by
Andy Green
Browse files
Options
Downloads
Patches
Plain Diff
README.coding add note about closing connections
Signed-off-by:
Andy Green
<
andy.green@linaro.org
>
parent
fbf48227
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.coding
+21
-0
21 additions, 0 deletions
README.coding
with
21 additions
and
0 deletions
README.coding
+
21
−
0
View file @
099f789d
...
...
@@ -67,6 +67,27 @@ in the ...WRITEABLE callback.
See the test server code for an example of how to do this.
Closing connections from the user side
--------------------------------------
When you want to close a connection, you do it by returning -1 from a
callback for that connection.
You can provoke a callback by calling libwebsocket_callback_on_writable on
the wsi, then notice in the callback you want to close it and just return -1.
But usually, the decision to close is made in a callback already and returning
-1 is simple.
If the socket knows the connection is dead, because the peer closed or there
was an affirmitive network error like a FIN coming, then libwebsockets will
take care of closing the connection automatically.
If you have a silently dead connection, it's possible to enter a state where
the send pipe on the connection is choked but no ack will ever come, so the
dead connection will never become writeable. To cover that, you can use TCP
keepalives (see later in this document)
Fragmented messages
-------------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment