MCPcopy Index your code
hub / github.com/gopherdata/gophernotes / SendResponse

Method SendResponse

messages.go:143–161  ·  view source on GitHub ↗

SendResponse sends a message back to return identities of the received message.

(socket zmq4.Socket, msg ComposedMsg)

Source from the content-addressed store, hash-verified

141
142// SendResponse sends a message back to return identities of the received message.
143func (receipt *msgReceipt) SendResponse(socket zmq4.Socket, msg ComposedMsg) error {
144
145 msgParts, err := msg.ToWireMsg(receipt.Sockets.Key)
146 if err != nil {
147 return err
148 }
149
150 var frames = make([][]byte, 0, len(receipt.Identities)+1+len(msgParts))
151 frames = append(frames, receipt.Identities...)
152 frames = append(frames, []byte("<IDS|MSG>"))
153 frames = append(frames, msgParts...)
154
155 err = socket.SendMulti(zmq4.NewMsgFrom(frames...))
156 if err != nil {
157 return err
158 }
159
160 return nil
161}
162
163// NewMsg creates a new ComposedMsg to respond to a parent message.
164// This includes setting up its headers.

Callers 2

PublishMethod · 0.95
ReplyMethod · 0.95

Calls 1

ToWireMsgMethod · 0.80

Tested by

no test coverage detected