github.com/aergoio/aergo@v1.3.1/cmd/aergosvr/svrhandler.go (about)

     1  /**
     2   *  @file
     3   *  @copyright defined in aergo/LICENSE.txt
     4   */
     5  package main
     6  
     7  // BaseDispatcher is basic implementation of RequestDispatcher
     8  // type BaseDispatcher struct {
     9  // 	netsrv.RequestDispatcher
    10  
    11  // 	listeners []netsrv.Listener
    12  // }
    13  
    14  // var dispatcher *BaseDispatcher
    15  
    16  // func createDispatcher(cfg *config.Config) *BaseDispatcher {
    17  // 	dispatcher = &BaseDispatcher{}
    18  
    19  // 	httpListener := CreateHTTPListener(cfg, dispatcher)
    20  // 	rpcListener := CreateRPCListener(cfg, dispatcher)
    21  
    22  // 	dispatcher.listeners = []netsrv.Listener{httpListener, rpcListener}
    23  // 	for _, listener := range dispatcher.listeners {
    24  
    25  // 		go listener.Start()
    26  // 	}
    27  
    28  // 	return dispatcher
    29  // }
    30  
    31  // func (d *BaseDispatcher) Stop() {
    32  // 	for _, listener := range d.listeners {
    33  // 		listener.Stop()
    34  // 	}
    35  // }