Decouple StartHTTP{,AndTLS}Server from Listen() (#2791)

* Decouple StartHTTP{,AndTLS}Server from Listen()

This should help solve cosmos/cosmos-sdk#2715

* Fix small mistake

* Update StartGRPCServer

* s/rpc/rpcserver/

* Start grpccore.StartGRPCServer in a goroutine

* Reinstate l.Close()

* Fix rpc/lib/test/main.go

* Update code comment

* update changelog and comments

* fix tm-monitor. more comments
This commit is contained in:
Alessio Treglia
2018-11-15 20:33:04 +00:00
committed by Ethan Buchman
parent be8c2d5018
commit b646437ec7
11 changed files with 126 additions and 151 deletions

View File

@ -48,13 +48,13 @@ Examples:
logger = log.NewTMLogger(log.NewSyncWriter(os.Stdout))
}
m := startMonitor(flag.Arg(0))
monitor := startMonitor(flag.Arg(0))
startRPC(listenAddr, m, logger)
listener := startRPC(listenAddr, monitor, logger)
var ton *Ton
if !noton {
ton = NewTon(m)
ton = NewTon(monitor)
ton.Start()
}
@ -62,7 +62,8 @@ Examples:
if !noton {
ton.Stop()
}
m.Stop()
monitor.Stop()
listener.Close()
})
}