Skip to content

可否像brpc client一样,支持用户自定义的 Codec支持链接多路复用 #1851

@liuguanyu-xjtu

Description

@liuguanyu-xjtu

对于基于tcp的二进制协议,kitex写死了只有tthead协议支持多路复用,而用户自定义的协议并不支持多路复用,一个并发需要一个tcp链接,而成熟的rpc框架例如 brpc trpc 基本上都支持用户自定的协议也支持链接多路复用。大致需要这样

type MuxCodec interface {
	Encode(ctx context.Context, msg Message, out ByteBuffer) error

        PreDecode(in ByteBuffer) (interface{}, int32, error)
	ContinueDecode(ctx context.Context, parse_ctx interface{}, msg Message, in ByteBuffer) error
	Name() string
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions