Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Issue 8399039: Explicitly handle listen sockets and connection sockets differently in Linux and Mac OS eventhandler (Closed)

Created:
9 years, 1 month ago by Søren Gjesse
Modified:
9 years, 1 month ago
Reviewers:
Mads Ager (google)
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Explicitly handle listen sockets and connection sockets differently in Linux and Mac OS eventhandler Previously the assumption was that an POLLIN event with no data available was from a listen socket with pending accepts. However a POLLIN event from a connection socket can have no data available if the data has been read before the event is processed. R=ager@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=878

Patch Set 1 #

Patch Set 2 : Fix Mac OS build #

Total comments: 6

Patch Set 3 : Addressed review comments from ager@ #

Patch Set 4 : Fix Mac OS build #

Unified diffs Side-by-side diffs Delta from patch set Stats (+94 lines, -63 lines) Patch
M runtime/bin/eventhandler.h View 1 2 1 chunk +10 lines, -8 lines 0 comments Download
M runtime/bin/eventhandler_linux.h View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/bin/eventhandler_linux.cc View 1 2 3 chunks +29 lines, -24 lines 0 comments Download
M runtime/bin/eventhandler_macos.h View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/bin/eventhandler_macos.cc View 1 2 3 4 chunks +29 lines, -24 lines 0 comments Download
M runtime/bin/socket_impl.dart View 1 2 3 5 chunks +24 lines, -7 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Søren Gjesse
9 years, 1 month ago (2011-10-27 15:03:20 UTC) #1
Mads Ager (google)
lgtm http://codereview.chromium.org/8399039/diff/2001/runtime/bin/eventhandler.h File runtime/bin/eventhandler.h (right): http://codereview.chromium.org/8399039/diff/2001/runtime/bin/eventhandler.h#newcode30 runtime/bin/eventhandler.h:30: kListenSocket = 16, The naming here confuses me. ...
9 years, 1 month ago (2011-10-28 08:33:23 UTC) #2
Søren Gjesse
9 years, 1 month ago (2011-10-28 09:24:18 UTC) #3
http://codereview.chromium.org/8399039/diff/2001/runtime/bin/eventhandler.h
File runtime/bin/eventhandler.h (right):

http://codereview.chromium.org/8399039/diff/2001/runtime/bin/eventhandler.h#n...
runtime/bin/eventhandler.h:30: kListenSocket = 16,
On 2011/10/28 08:33:23, Mads Ager wrote:
> The naming here confuses me. 4 Events, 1 Command and something that is
neither?
> Can we streamline that? Or maybe the enum shouldn't be called Message? 

So this is the bits that we send to the event loop when stuff changes for a file
descriptor. I will rename to MessageFlags and provide a better comment.

http://codereview.chromium.org/8399039/diff/2001/runtime/bin/eventhandler_lin...
File runtime/bin/eventhandler_linux.cc (right):

http://codereview.chromium.org/8399039/diff/2001/runtime/bin/eventhandler_lin...
runtime/bin/eventhandler_linux.cc:100: return (port_map_[fd].mask & (1 <<
kListenSocket)) != 0;
On 2011/10/28 08:33:23, Mads Ager wrote:
> kListeningSocket?

Done.

http://codereview.chromium.org/8399039/diff/2001/runtime/bin/eventhandler_lin...
runtime/bin/eventhandler_linux.cc:222: if ((pollfd->revents & POLLIN) != 0)
event_mask |= (1 << kInEvent);
On 2011/10/28 08:33:23, Mads Ager wrote:
> Should we assert that there is no overlap in these? Can we ever get more than
> one of these and what does that mean?

I would be reluctant to try to assert anything here. However reading the
documentation once more both POLLHUP and POLLERR are always provided together
with POLLIN, so POLLIN should only mean "connections ready for accept" if
provided alone.

Powered by Google App Engine
This is Rietveld 408576698