mm_rpc_sever

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Asker

type Asker struct {
	IsMult        bool
	SessionId     string
	Ch            chan model.MsgReq
	MAskServer    grpc.ServerStreamingServer[pb.MRpcMessageAck]
	MStreamServer grpc.BidiStreamingServer[pb.MRpcMessage, pb.MRpcMessageAck]
}

func (*Asker) Ask

func (asker *Asker) Ask(msgId int32, data []byte) error

type IServerMsgHandle

type IServerMsgHandle interface {
	/**
	*  客户端相应请求
	 */
	HandleRequest(sessionId string, msgId int32, data []byte) (int32, []byte, error)

	/**
	* 客户端单请求,多次Resp
	 */
	RequestMultResp(sessionId string, msgId int32, data []byte, ask *Asker) error

	/**
	 * 客户端多请求,单次Resp
	 */
	MultiRequest(ch chan model.MsgReq) (int32, []byte, error)

	/**
	* 双向流
	 */
	DuplexStream(ch chan model.MsgReq, ask *Asker) error
}

type MRpcServer

type MRpcServer struct {
	pb.UnimplementedMRpcServiceServer

	Context    context.Context
	CancelFunc context.CancelFunc
	// contains filtered or unexported fields
}

func (*MRpcServer) DuplexStream

func (*MRpcServer) MultRequest

func (*MRpcServer) Request

func (s *MRpcServer) Request(_ context.Context, msg *pb.MRpcMessage) (*pb.MRpcMessageAck, error)

func (*MRpcServer) RequestMultResp

func (s *MRpcServer) RequestMultResp(msg *pb.MRpcMessage, stream grpc.ServerStreamingServer[pb.MRpcMessageAck]) error

func (*MRpcServer) StartServer

func (s *MRpcServer) StartServer(port int, handle IServerMsgHandle) error

func (*MRpcServer) StopServer

func (s *MRpcServer) StopServer() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL