github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/net/rpc/jsonrpc/server.go (about) 1 // Copyright 2010 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package jsonrpc 6 7 import ( 8 "github.com/shogo82148/std/io" 9 "github.com/shogo82148/std/net/rpc" 10 ) 11 12 // NewServerCodecはconn上でJSON-RPCを使用する新しい [rpc.ServerCodec] を返します。 13 func NewServerCodec(conn io.ReadWriteCloser) rpc.ServerCodec 14 15 // ServeConnは単一の接続でJSON-RPCサーバーを実行します。 16 // ServeConnはブロックし、クライアントが切断するまで接続を処理します。 17 // 呼び出し元は通常、goステートメントでServeConnを呼び出します。 18 func ServeConn(conn io.ReadWriteCloser)