func (networkBus *NetworkBus) Start() error {
	var err error
	service := networkBus.service
	clientService := networkBus.Client.service
	serverService := networkBus.Server.service
	if !service.started {
		server := rpc.NewServer()
		server.RegisterName("ServerService", serverService)
		server.RegisterName("ClientService", clientService)
		server.HandleHTTP(networkBus.path, "/debug"+networkBus.path)
		l, e := net.Listen("tcp", networkBus.address)
		if e != nil {
			err = fmt.Errorf("listen error: %v", e)
		}
		service.wg.Add(1)
		go http.Serve(l, nil)
	} else {
		err = errors.New("Server bus already started")
	}
	return err
}
func (networkBus *NetworkBus) Start() error {
	var err error
	service := networkBus.service
	clientService := networkBus.Client.service
	serverService := networkBus.Server.service
	if !service.started {
		server := rpc.NewServer()
		server.RegisterName("ServerService", serverService)
		server.RegisterName("ClientService", clientService)
		server.HandleHTTP(networkBus.path, "/debug"+networkBus.path)
		l, e := net.Listen("tcp", networkBus.address)
		if e != nil {
			err = fmt.Errorf("listen error: %v", e)
		}
		service.wg.Add(1)
		go http.Serve(l, nil)
	} else {
		err = errors.New("Server bus already started")
	}
	return err
}
func ( networkBus * NetworkBus ) Start ( ) error { var err error service := networkBus . service clientService := networkBus . Client . service serverService := networkBus . Server . service if ! service . started { server := rpc . NewServer ( ) server . RegisterName ( " " , serverService ) server . RegisterName ( " " , clientService ) server . HandleHTTP ( networkBus . path , " " + networkBus . path ) l , e := net . Listen ( " " , networkBus . address ) if e != nil { err = fmt . Errorf ( " " , e ) } service . wg . Add ( 1 ) go http . Serve ( l , nil ) } else { err = errors . New ( " " ) } return err }
// Start - helper method to serve a network bus service
Start - helper method to serve a network bus service