From 78745551c077bf54151202138c2629f288769561 Mon Sep 17 00:00:00 2001 From: Determinant Date: Tue, 15 Sep 2020 23:55:34 -0400 Subject: WIP: geth-tavum --- rpc/server.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'rpc/server.go') diff --git a/rpc/server.go b/rpc/server.go index bf5d93e..64e078a 100644 --- a/rpc/server.go +++ b/rpc/server.go @@ -22,7 +22,7 @@ import ( "sync/atomic" mapset "github.com/deckarep/golang-set" - "github.com/ava-labs/go-ethereum/log" + "github.com/ethereum/go-ethereum/log" ) const MetadataApi = "rpc" @@ -36,7 +36,7 @@ const ( // OptionMethodInvocation is an indication that the codec supports RPC method calls OptionMethodInvocation CodecOption = 1 << iota - // OptionSubscriptions is an indication that the codec suports RPC notifications + // OptionSubscriptions is an indication that the codec supports RPC notifications OptionSubscriptions = 1 << iota // support pub sub ) @@ -72,7 +72,7 @@ func (s *Server) RegisterName(name string, receiver interface{}) error { // // Note that codec options are no longer supported. func (s *Server) ServeCodec(codec ServerCodec, options CodecOption) { - defer codec.Close() + defer codec.close() // Don't serve if server is stopped. if atomic.LoadInt32(&s.run) == 0 { @@ -84,7 +84,7 @@ func (s *Server) ServeCodec(codec ServerCodec, options CodecOption) { defer s.codecs.Remove(codec) c := initClient(codec, s.idgen, &s.services) - <-codec.Closed() + <-codec.closed() c.Close() } @@ -101,10 +101,10 @@ func (s *Server) serveSingleRequest(ctx context.Context, codec ServerCodec) { h.allowSubscribe = false defer h.close(io.EOF, nil) - reqs, batch, err := codec.Read() + reqs, batch, err := codec.readBatch() if err != nil { if err != io.EOF { - codec.Write(ctx, errorMessage(&invalidMessageError{"parse error"})) + codec.writeJSON(ctx, errorMessage(&invalidMessageError{"parse error"})) } return } @@ -122,7 +122,7 @@ func (s *Server) Stop() { if atomic.CompareAndSwapInt32(&s.run, 1, 0) { log.Debug("RPC server shutting down") s.codecs.Each(func(c interface{}) bool { - c.(ServerCodec).Close() + c.(ServerCodec).close() return true }) } -- cgit v1.2.3