Title: Add new TCPTransport base class · Issue #286 · python/asyncio · GitHub
Open Graph Title: Add new TCPTransport base class · Issue #286 · python/asyncio
X Title: Add new TCPTransport base class · Issue #286 · python/asyncio
Description: In uvloop (more details here) I implement Transports on top of libuv streams. Here's documentation on TCP and general streams. Streams are an opaque abstraction over sockets API. All buffering is implemented in the libuv core. There is a...
Open Graph Description: In uvloop (more details here) I implement Transports on top of libuv streams. Here's documentation on TCP and general streams. Streams are an opaque abstraction over sockets API. All buffering is i...
X Description: In uvloop (more details here) I implement Transports on top of libuv streams. Here's documentation on TCP and general streams. Streams are an opaque abstraction over sockets API. All buffering ...
Opengraph URL: https://github.com/python/asyncio/issues/286
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add new TCPTransport base class","articleBody":"In [uvloop](https://github.com/1st1/uvloop) (more details [here](https://github.com/python/asyncio/issues/282#issuecomment-155957235)) I implement Transports on top of libuv streams. Here's documentation on [TCP](http://docs.libuv.org/en/v1.x/tcp.html#c.uv_tcp_nodelay) and [general streams](http://docs.libuv.org/en/v1.x/stream.html#api).\n\nStreams are an opaque abstraction over sockets API. All buffering is implemented in the libuv core. There is actually no way to access the underlying socket, which causes some problems. Right now, if you want to set `TCP_NODELAY` or `SO_KEEPALIVE`, the only way is to call `Transport.get_extra_info('socket')` and set them manually. That's what aiohttp is [doing](https://github.com/KeepSafe/aiohttp/blob/be9ab0e993785ad94bccfd9e4d927858c75bf725/aiohttp/server.py#L30), for instance.\n\nI propose to add a new `Transport` base class - `TCPTransport`. It will have two specific to TCP methods: `set_nodelay(bool enabled)` and `set_keepalive(bool enabled)`.\n\nWithout these methods, it's virtually impossible for me to create a transport that provides this functionality on top of libuv. This is very similar to how this is done in [Twisted](http://twistedmatrix.com/documents/8.1.0/api/twisted.internet.tcp.Connection.html) and in [Tornado](http://www.tornadoweb.org/en/stable/iostream.html#tornado.iostream.BaseIOStream.set_nodelay).\n","author":{"url":"https://github.com/1st1","@type":"Person","name":"1st1"},"datePublished":"2015-11-12T06:42:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/286/asyncio/issues/286"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d3a078a7-df78-d775-be03-830a858cee65 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AD36:1272F1:109266A:171AE0B:696A8C44 |
| html-safe-nonce | 2ca76ef17f573570c9f456ac435c8d1bc5c18d01e317bf6b1599af7a93f589ee |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRDM2OjEyNzJGMToxMDkyNjZBOjE3MUFFMEI6Njk2QThDNDQiLCJ2aXNpdG9yX2lkIjoiNzI3OTQ0MDMzNDAyODQ0MjY5MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5183661e611049316573bd575bc9da38f07769466e4db15c893de10a8887d574 |
| hovercard-subject-tag | issue:116490227 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/asyncio/286/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5e203c4920704aca2adbc74d27803ffed4785f10b97391d917300912be3a1466/python/asyncio/issues/286 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5e203c4920704aca2adbc74d27803ffed4785f10b97391d917300912be3a1466/python/asyncio/issues/286 |
| og:image:alt | In uvloop (more details here) I implement Transports on top of libuv streams. Here's documentation on TCP and general streams. Streams are an opaque abstraction over sockets API. All buffering is i... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | 1st1 |
| hostname | github.com |
| expected-hostname | github.com |
| None | d2aa6dedd7d97fa651b17c40401f2605f309df5ca5fb659bf0554cf34f1de825 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/asyncio git https://github.com/python/asyncio.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 33739295 |
| octolytics-dimension-repository_nwo | python/asyncio |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 33739295 |
| octolytics-dimension-repository_network_root_nwo | python/asyncio |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c1dbca8981c5e3d6a69bce2f1d289e732b86241d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width