]> Cypherpunks repositories - gostls13.git/commit
net/rpc: clarify requirements for connections and codecs
authorDmitry Vyukov <dvyukov@google.com>
Tue, 26 Jun 2018 11:28:04 +0000 (13:28 +0200)
committerDmitry Vyukov <dvyukov@google.com>
Tue, 24 Jul 2018 09:23:08 +0000 (09:23 +0000)
commit08ab820437229f68fe5f7dad1c9b4940c674e206
tree657e05a811f0b1ef4fcf18875059411142a307ab
parent6df4c3a44b20b9738ae5699fbc156052522f9f54
net/rpc: clarify requirements for connections and codecs

1. Connections and codecs need to be partially safe for concurrent use.
   Namely, read side is serialized by one mutex,
   and writing side is serialized by another.
   Current comment says that they need to be fully thread-safe,
   which makes the default implementations (gobClientCodec/gobServerCodec)
   non-conforming.

2. Say that ServerCodec.Close can be called multiple times
   and must be idempotent. Server requires this and gobServerCodec
   accounts for this,  but the requirement is not documented.

Change-Id: Ie877e37891fed28056e3d9d1722edaed8e154067
Reviewed-on: https://go-review.googlesource.com/120818
Reviewed-by: Rob Pike <r@golang.org>
src/net/rpc/client.go
src/net/rpc/server.go