Make sure Future get notified before event is fired. See #254

This commit is contained in:
Norman Maurer 2012-04-07 21:56:58 +02:00
parent db87c6ea37
commit 33c085b9b9

View File

@ -110,13 +110,13 @@ class OioWorker extends AbstractOioWorker<OioSocketChannel> {
a.getBytes(a.readerIndex(), out, length); a.getBytes(a.readerIndex(), out, length);
} }
} }
future.setSuccess();
if (iothread) { if (iothread) {
fireWriteComplete(channel, length); fireWriteComplete(channel, length);
} else { } else {
fireWriteCompleteLater(channel, length); fireWriteCompleteLater(channel, length);
} }
future.setSuccess();
} catch (Throwable t) { } catch (Throwable t) {
// Convert 'SocketException: Socket closed' to // Convert 'SocketException: Socket closed' to