Comments (2)
Hi @Lukasa!
Spec says: Endpoints SHOULD send a GOAWAY frame when ending a connection, providing that circumstances permit it.
So when shutting down gracefully we need to call close
on all streams and then send a final GoAway
frame on the connection control stream, something like:
# Close all streams
for stream in list(self.streams.values()):
print("Closing stream with id %d" % stream.stream_id)
stream.close()
# Send GoAway frame to the server
self._send_cb(GoAwayFrame(0), True)
I think we should also close the stream for connection control with id 0, but I'm not sure yet where it is.
On a related matter, the spec also says An endpoint that receives an unexpected stream identifier MUST respond with a connection error (Section 5.4.1) of type PROTOCOL_ERROR. I don't think we are validating if the stream identifier actually exists or not on the client side. Code looks as follow right now:
self.streams[frame.stream_id].receive_frame(frame)
I guess we should validate first if this stream_id
exists inside the streams collection, right?
from hyper.
I think we should also close the stream for connection control with id 0, but I'm not sure yet where it is.
Stream zero always exists, and there is no need to explicitly close it.
I guess we should validate first if this stream_id exists inside the streams collection, right?
A try...except block would be better style, but yes. =)
So when shutting down gracefully we need to call close on all streams and then send a final GoAway frame on the connection control stream
Sounds like a good idea to me!
from hyper.
Related Issues (20)
- Ping does not work correctly HOT 3
- Edit on github link on RTD broken.
- Transfer of maintenance HOT 3
- HTTP20Adapter sends extra headers ?? HOT 20
- How to control ssl context in a HTTP20Adapter HOT 1
- hyper.contrib.HTTP20Adapter with requests.session not working on python 2.7
- Upgrade from HTTP/1.1. to HTTP2 not working HOT 2
- Could you please make MAX_CHUNK configurable? HOT 1
- Upgrade to the latest h2 HOT 2
- How resolve DNS to a specific IP?
- HTTP11Connection does not use http/1.1 protocol HOT 1
- hyper hangs while POSTing to Apple APNS servers HOT 2
- Forcing Cleartext HTTP2 Without Upgrade Mechanism HOT 3
- How can I add query parameters when using class HTTP20Connection?
- Python deprecation warnings: collections, imp, logging.warn
- basestring erroneously ignores unicode in Python2.7
- Client certificates?
- Retain connection in HTTP/2 using hyper to avoid authentication for every request
- HTTP20Connection.request has no mechanism to send duplicate headers HOT 3
- The orders of sending packages in Debug mode and Run mode are different.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hyper.