Fix Http/2 example response timeout
Motivation: The HTTP/2 example can timeout at the client waiting for a response due to the server not flushing after writing the response. Modifications: Updated the server's HelloWorldHttp2Handler to flush after writing the response. Result: The HTTP/2 example runs successfully.
This commit is contained in:
parent
f8890768be
commit
217d921075
@ -120,6 +120,7 @@ public class HelloWorldHttp2Handler extends Http2ConnectionHandler {
|
|||||||
Http2Headers headers = new DefaultHttp2Headers().status(new AsciiString("200"));
|
Http2Headers headers = new DefaultHttp2Headers().status(new AsciiString("200"));
|
||||||
frameWriter.writeHeaders(ctx, streamId, headers, 0, false, ctx.newPromise());
|
frameWriter.writeHeaders(ctx, streamId, headers, 0, false, ctx.newPromise());
|
||||||
frameWriter.writeData(ctx, streamId, payload, 0, true, ctx.newPromise());
|
frameWriter.writeData(ctx, streamId, payload, 0, true, ctx.newPromise());
|
||||||
|
ctx.flush();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user