From 33c085b9b9a27f442e762a0234a27bd6afe5169e Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Sat, 7 Apr 2012 21:56:58 +0200 Subject: [PATCH] Make sure Future get notified before event is fired. See #254 --- .../src/main/java/io/netty/channel/socket/oio/OioWorker.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transport/src/main/java/io/netty/channel/socket/oio/OioWorker.java b/transport/src/main/java/io/netty/channel/socket/oio/OioWorker.java index 5d4eb6aa3b..fa4578d3d4 100644 --- a/transport/src/main/java/io/netty/channel/socket/oio/OioWorker.java +++ b/transport/src/main/java/io/netty/channel/socket/oio/OioWorker.java @@ -110,13 +110,13 @@ class OioWorker extends AbstractOioWorker { a.getBytes(a.readerIndex(), out, length); } } - + + future.setSuccess(); if (iothread) { fireWriteComplete(channel, length); } else { fireWriteCompleteLater(channel, length); } - future.setSuccess(); } catch (Throwable t) { // Convert 'SocketException: Socket closed' to