mirror of
https://github.com/jlengrand/vert.x.git
synced 2026-03-10 08:51:19 +00:00
NetSocket end message should be dispatched correctly on the context
This commit is contained in:
@@ -359,8 +359,7 @@ public class NetSocketImpl extends ConnectionBase implements NetSocketInternal {
|
||||
consumer = registration;
|
||||
registration = null;
|
||||
}
|
||||
// Should be done with dispatch....
|
||||
pending.write(InboundBuffer.END_SENTINEL);
|
||||
context.dispatch(InboundBuffer.END_SENTINEL, pending::write);
|
||||
super.handleClosed();
|
||||
if (consumer != null) {
|
||||
consumer.unregister();
|
||||
|
||||
@@ -2427,7 +2427,8 @@ public class NetTest extends VertxTestBase {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInWorker() throws Exception {
|
||||
public void testInWorker() {
|
||||
waitFor(2);
|
||||
vertx.deployVerticle(new AbstractVerticle() {
|
||||
@Override
|
||||
public void start() throws Exception {
|
||||
@@ -2441,7 +2442,16 @@ public class NetTest extends VertxTestBase {
|
||||
assertSame(context, Vertx.currentContext());
|
||||
conn.handler(conn::write);
|
||||
conn.closeHandler(v -> {
|
||||
testComplete();
|
||||
assertTrue(Vertx.currentContext().isWorkerContext());
|
||||
assertTrue(Context.isOnWorkerThread());
|
||||
assertSame(context, Vertx.currentContext());
|
||||
complete();
|
||||
});
|
||||
conn.endHandler(v -> {
|
||||
assertTrue(Vertx.currentContext().isWorkerContext());
|
||||
assertTrue(Context.isOnWorkerThread());
|
||||
assertSame(context, Vertx.currentContext());
|
||||
complete();
|
||||
});
|
||||
}).listen(testAddress, onSuccess(s -> {
|
||||
assertTrue(Vertx.currentContext().isWorkerContext());
|
||||
|
||||
Reference in New Issue
Block a user