ServerTransportStreamFromContext returns the ServerTransportStream saved in ctx. Returns nil if the given context has no stream associated with it (which implies it is not an RPC invocation context). # Experimental Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
(ctx context.Context)
| 1931 | // Notice: This API is EXPERIMENTAL and may be changed or removed in a |
| 1932 | // later release. |
| 1933 | func ServerTransportStreamFromContext(ctx context.Context) ServerTransportStream { |
| 1934 | s, _ := ctx.Value(streamKey{}).(ServerTransportStream) |
| 1935 | return s |
| 1936 | } |
| 1937 | |
| 1938 | // Stop stops the gRPC server. It immediately closes all open |
| 1939 | // connections and listeners. |