MCPcopy Create free account
hub / github.com/CPChain/chain / ServeCodec

Method ServeCodec

api/rpc/server.go:217–220  ·  view source on GitHub ↗

ServeCodec reads incoming requests from codec, calls the appropriate callback and writes the response back using the given codec. It will block until the codec is closed or the server is stopped. In either case the codec is closed.

(codec ServerCodec, options CodecOption)

Source from the content-addressed store, hash-verified

215// response back using the given codec. It will block until the codec is closed or the server is
216// stopped. In either case the codec is closed.
217func (s *Server) ServeCodec(codec ServerCodec, options CodecOption) {
218 defer codec.Close()
219 s.serveRequest(context.Background(), codec, false, options)
220}
221
222// ServeSingleRequest reads and processes a single RPC request from the given codec. It will not
223// close the codec unless a non-recoverable error has occurred. Note, this method will return after

Callers 6

TestNotificationsFunction · 0.95
WebsocketHandlerMethod · 0.95
ServeListenerMethod · 0.95
DialInProcFunction · 0.80

Calls 2

serveRequestMethod · 0.95
CloseMethod · 0.65

Tested by 3

TestNotificationsFunction · 0.76