private static ChannelCloseHeader MergeToProto(ChannelCloseHeader proto, ITransportChannelCloseHeader messageHeader) { proto = proto ?? new ChannelCloseHeader(); proto.ChannelId = proto.ChannelId.MergeFrom(messageHeader.ChannelId); proto.Completion = proto.Completion.MergeFrom(messageHeader.Completion); return(proto); }
public IPooledBuffer Handle(ITransportChannelCloseHeader header, Nothing _) { using (var headerProto = Header.Rent()) using (var channelCloseProto = ChannelCloseHeader.Rent()) { headerProto.ChannelClose = MergeToProto(channelCloseProto, header); return(headerProto.Serialize()); } }
private ITransportChannelCloseHeader ConvertFromProto(ChannelCloseHeader proto) { return(_headerFactory.CreateChannelCloseHeader(proto.ChannelId.ConvertFromProtoStrict(), proto.Completion.ConvertFromProto())); }