mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-12 21:01:21 +00:00
QuitService->BaseService
This commit is contained in:
@ -15,7 +15,7 @@ import (
|
||||
// var maxNumberConnections = 2
|
||||
|
||||
type SocketServer struct {
|
||||
QuitService
|
||||
BaseService
|
||||
|
||||
proto string
|
||||
addr string
|
||||
@ -39,13 +39,13 @@ func NewSocketServer(protoAddr string, app types.Application) (Service, error) {
|
||||
app: app,
|
||||
conns: make(map[int]net.Conn),
|
||||
}
|
||||
s.QuitService = *NewQuitService(nil, "TMSPServer", s)
|
||||
s.BaseService = *NewBaseService(nil, "TMSPServer", s)
|
||||
_, err := s.Start() // Just start it
|
||||
return s, err
|
||||
}
|
||||
|
||||
func (s *SocketServer) OnStart() error {
|
||||
s.QuitService.OnStart()
|
||||
s.BaseService.OnStart()
|
||||
ln, err := net.Listen(s.proto, s.addr)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -56,7 +56,7 @@ func (s *SocketServer) OnStart() error {
|
||||
}
|
||||
|
||||
func (s *SocketServer) OnStop() {
|
||||
s.QuitService.OnStop()
|
||||
s.BaseService.OnStop()
|
||||
s.listener.Close()
|
||||
|
||||
s.connsMtx.Lock()
|
||||
|
Reference in New Issue
Block a user