Browse Source

Merge pull request #82 from tendermint/feature/adrian-#79

Update grpc_server.go - 2
pull/1780/head
Ethan Buchman 8 years ago
committed by GitHub
parent
commit
fadfcfdcb0
2 changed files with 12 additions and 2 deletions
  1. +3
    -2
      server/grpc_server.go
  2. +9
    -0
      server/server.go

+ 3
- 2
server/grpc_server.go View File

@ -10,8 +10,6 @@ import (
cmn "github.com/tendermint/tmlibs/common"
)
// var maxNumberConnections = 2
type GRPCServer struct {
cmn.BaseService
@ -23,6 +21,7 @@ type GRPCServer struct {
app types.ABCIApplicationServer
}
// NewGRPCServer returns a new gRPC ABCI server
func NewGRPCServer(protoAddr string, app types.ABCIApplicationServer) (cmn.Service, error) {
parts := strings.SplitN(protoAddr, "://", 2)
proto, addr := parts[0], parts[1]
@ -37,6 +36,7 @@ func NewGRPCServer(protoAddr string, app types.ABCIApplicationServer) (cmn.Servi
return s, err
}
// OnStart starts the gRPC service
func (s *GRPCServer) OnStart() error {
s.BaseService.OnStart()
ln, err := net.Listen(s.proto, s.addr)
@ -50,6 +50,7 @@ func (s *GRPCServer) OnStart() error {
return nil
}
// OnStop stops the gRPC server
func (s *GRPCServer) OnStop() {
s.BaseService.OnStop()
s.server.Stop()


+ 9
- 0
server/server.go View File

@ -1,3 +1,12 @@
/*
Package server is used to start a new ABCI server.
It contains two server implementation:
* gRPC server
* socket server
*/
package server
import (


Loading…
Cancel
Save