Opened 10 years ago

Last modified 10 years ago

#4357 task new

Refactor _doReadOrWrite implementations to remove duplication

Reported by: Jean-Paul Calderone Owned by:
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch:
Author:

Description

twisted/internet/pollreactor.py, twisted/internet/epollreactor.py, and twisted/internet/gtk2reactor.py all contain _doReadOrWrite implementations which bear a striking resemblance to each other.

It would be nice if these poll-like reactors could all share one implementation of this logic.

One thing to note is that gtk2reactor behaves subtly differently from the others with respect to half-close. If a selectable is both readable and writeable simultaneously, pollreactor and epollreactor will treat write errors as completely closing the connection. gtk2reactor, on the other hand, appears as though it will treat this case as a half-close. The latter behavior seems wrong and should probably be eliminated by the refactoring. Adding a test for it might also be nice.

Change History (3)

comment:1 Changed 10 years ago by Glyph

Owner: changed from Glyph to Jean-Paul Calderone

comment:2 Changed 10 years ago by Jean-Paul Calderone

This is fixed in the #4539 branch

comment:3 Changed 9 years ago by <automation>

Owner: Jean-Paul Calderone deleted
Note: See TracTickets for help on using tickets.