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)
| 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. |
| 217 | func (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 |