From 15119bc461eb3f2fc2de8aae8f22ccb19b7fe080 Mon Sep 17 00:00:00 2001 From: jianbin Date: Thu, 11 Apr 2024 10:55:55 +0800 Subject: [PATCH] write and flush methods are provided --- .../com/alipay/remoting/RemotingContext.java | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/alipay/remoting/RemotingContext.java b/src/main/java/com/alipay/remoting/RemotingContext.java index f21d7dbb..0c3eb829 100644 --- a/src/main/java/com/alipay/remoting/RemotingContext.java +++ b/src/main/java/com/alipay/remoting/RemotingContext.java @@ -105,13 +105,31 @@ public RemotingContext(ChannelHandlerContext ctx, InvokeContext invokeContext, /** * Wrap the writeAndFlush method. * - * @param msg - * @return + * @param msg as msg + * @return channel future */ public ChannelFuture writeAndFlush(RemotingCommand msg) { return this.channelContext.writeAndFlush(msg); } + /** + * Wrap the write method. + * + * @param msg as msg + * @return channel future + */ + public ChannelFuture write(RemotingCommand msg) { + return this.channelContext.write(msg); + } + + /** + * Wrap the write method. + * + */ + public void flush() { + this.channelContext.flush(); + } + /** * whether this request already timeout *