# package jsonrpc
`import "net/rpc/jsonrpc"`
jsonrpc包实现了JSON-RPC的ClientCodec和ServerCodec接口,可用于rpc包。
## Index
* [func Dial(network, address string) (\*rpc.Client, error)](#Dial)
* [func NewClient(conn io.ReadWriteCloser) \*rpc.Client](#NewClient)
* [func NewClientCodec(conn io.ReadWriteCloser) rpc.ClientCodec](#NewClientCodec)
* [func NewServerCodec(conn io.ReadWriteCloser) rpc.ServerCodec](#NewServerCodec)
* [func ServeConn(conn io.ReadWriteCloser)](#ServeConn)
## func [Dial](http://code.google.com/p/go/source/browse/src/pkg/net/rpc/jsonrpc/client.go?name=release#117 "View Source")
```
func Dial(network, address string) (*rpc.Client, error)
```
Dial在指定的网络和地址连接一个JSON-RPC服务端。
## func [NewClient](http://code.google.com/p/go/source/browse/src/pkg/net/rpc/jsonrpc/client.go?name=release#112 "View Source")
```
func NewClient(conn io.ReadWriteCloser) *rpc.Client
```
NewClient返回一个新的rpc.Client,以管理对连接另一端的服务的请求。
## func [NewClientCodec](http://code.google.com/p/go/source/browse/src/pkg/net/rpc/jsonrpc/client.go?name=release#36 "View Source")
```
func NewClientCodec(conn io.ReadWriteCloser) rpc.ClientCodec
```
NewClientCodec返回一个在连接上使用JSON-RPC的rpc.ClientCodec。
## func [NewServerCodec](http://code.google.com/p/go/source/browse/src/pkg/net/rpc/jsonrpc/server.go?name=release#37 "View Source")
```
func NewServerCodec(conn io.ReadWriteCloser) rpc.ServerCodec
```
NewServerCodec返回一个在连接上使用JSON-RPC的rpc. ServerCodec。
## func [ServeConn](http://code.google.com/p/go/source/browse/src/pkg/net/rpc/jsonrpc/server.go?name=release#132 "View Source")
```
func ServeConn(conn io.ReadWriteCloser)
```
ServeConn在单个连接上执行DefaultServer。ServeConn会阻塞,服务该连接直到客户端挂起。调用者一般应另开线程调用本函数:"go serveConn(conn)"。ServeConn在该连接使用JSON编解码格式。
- 库
- package achive
- package tar
- package zip
- package bufio
- package builtin
- package bytes
- package compress
- package bzip2
- package flate
- package gzip
- package lzw
- package zlib
- package container
- package heap
- package list
- package ring
- package crypto
- package aes
- package cipher
- package des
- package dsa
- package ecdsa
- package elliptic
- package hmac
- package md5
- package rand
- package rc4
- package rsa
- package sha1
- package sha256
- package sha512
- package subtle
- package tls
- package x509
- package pkix
- package database
- package sql
- package driver
- package encoding
- package ascii85
- package asn1
- package base32
- package base64
- package binary
- package csv
- package gob
- package hex
- package json
- package pem
- package xml
- package errors
- package expvar
- package flag
- package fmt
- package go
- package doc
- package format
- package parser
- package printer
- package hash
- package adler32
- package crc32
- package crc64
- package fnv
- package html
- package template
- package image
- package color
- package palette
- package draw
- package gif
- package jpeg
- package png
- package index
- package suffixarray
- package io
- package ioutil
- package log
- package syslog
- package math
- package big
- package cmplx
- package rand
- package mime
- package multipart
- package net
- package http
- package cgi
- package cookiejar
- package fcgi
- package httptest
- package httputil
- package pprof
- package mail
- package rpc
- package jsonrpc
- package smtp
- package textproto
- package url
- package os
- package exec
- package signal
- package user
- package path
- package filepath
- package reflect
- package regexp
- package runtime
- package cgo
- package debug
- package pprof
- package race
- package sort
- package strconv
- package strings
- package sync
- package atomic
- package text
- package scanner
- package tabwriter
- package template
- package time
- package unicode
- package utf16
- package utf8
- package unsafe