blob: 8a32f580dea23942b47e9a3729ecb80ca43c4c29 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
<h1> Package jsonrpc </h1> <ul id="short-nav">
<li><code>import "net/rpc/jsonrpc"</code></li>
<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
<li><a href="#pkg-index" class="indexLink">Index</a></li>
</ul> <h2 id="pkg-overview">Overview </h2> <p>Package jsonrpc implements a JSON-RPC 1.0 ClientCodec and ServerCodec for the rpc package. For JSON-RPC 2.0 support, see <a href="https://godoc.org/?q=json-rpc+2.0">https://godoc.org/?q=json-rpc+2.0</a> </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
<li><a href="#Dial">func Dial(network, address string) (*rpc.Client, error)</a></li>
<li><a href="#NewClient">func NewClient(conn io.ReadWriteCloser) *rpc.Client</a></li>
<li><a href="#NewClientCodec">func NewClientCodec(conn io.ReadWriteCloser) rpc.ClientCodec</a></li>
<li><a href="#NewServerCodec">func NewServerCodec(conn io.ReadWriteCloser) rpc.ServerCodec</a></li>
<li><a href="#ServeConn">func ServeConn(conn io.ReadWriteCloser)</a></li>
</ul> <h3>Package files</h3> <p> <span>client.go</span> <span>server.go</span> </p> <h2 id="Dial">func <span>Dial</span> </h2> <pre data-language="go">func Dial(network, address string) (*rpc.Client, error)</pre> <p>Dial connects to a JSON-RPC server at the specified network address. </p>
<h2 id="NewClient">func <span>NewClient</span> </h2> <pre data-language="go">func NewClient(conn io.ReadWriteCloser) *rpc.Client</pre> <p>NewClient returns a new <span>rpc.Client</span> to handle requests to the set of services at the other end of the connection. </p>
<h2 id="NewClientCodec">func <span>NewClientCodec</span> </h2> <pre data-language="go">func NewClientCodec(conn io.ReadWriteCloser) rpc.ClientCodec</pre> <p>NewClientCodec returns a new <span>rpc.ClientCodec</span> using JSON-RPC on conn. </p>
<h2 id="NewServerCodec">func <span>NewServerCodec</span> </h2> <pre data-language="go">func NewServerCodec(conn io.ReadWriteCloser) rpc.ServerCodec</pre> <p>NewServerCodec returns a new <span>rpc.ServerCodec</span> using JSON-RPC on conn. </p>
<h2 id="ServeConn">func <span>ServeConn</span> </h2> <pre data-language="go">func ServeConn(conn io.ReadWriteCloser)</pre> <p>ServeConn runs the JSON-RPC server on a single connection. ServeConn blocks, serving the connection until the client hangs up. The caller typically invokes ServeConn in a go statement. </p><div class="_attribution">
<p class="_attribution-p">
© Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
<a href="http://golang.org/pkg/net/rpc/jsonrpc/" class="_attribution-link">http://golang.org/pkg/net/rpc/jsonrpc/</a>
</p>
</div>
|