You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
471 B

9 years ago
9 years ago
9 years ago
9 years ago
  1. package server
  2. import (
  3. "fmt"
  4. . "github.com/tendermint/go-common"
  5. "github.com/tendermint/tmsp/types"
  6. )
  7. func NewServer(protoAddr, transport string, app types.Application) (Service, error) {
  8. var s Service
  9. var err error
  10. switch transport {
  11. case "socket":
  12. s, err = NewSocketServer(protoAddr, app)
  13. case "grpc":
  14. s, err = NewGRPCServer(protoAddr, types.NewGRPCApplication(app))
  15. default:
  16. err = fmt.Errorf("Unknown server type %s", transport)
  17. }
  18. return s, err
  19. }