mconnect - KDE Connect protocol implementation in Vala/C
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.

32 lines
511 B

  1. package main
  2. import (
  3. "context"
  4. "fmt"
  5. "os"
  6. "github.com/bboozzoo/mconnect/discovery"
  7. "github.com/bboozzoo/mconnect/logger"
  8. )
  9. var Stderr = os.Stderr
  10. func main() {
  11. ctx := context.Background()
  12. ctx = logger.WithContext(ctx, logger.New())
  13. log := logger.FromContext(ctx)
  14. log.Printf("setting up listener")
  15. l, err := discovery.NewListener()
  16. if err != nil {
  17. fmt.Fprintf(Stderr, "error: failed to setup listener: %v\n",
  18. err)
  19. os.Exit(1)
  20. }
  21. for {
  22. log.Printf("receive wait")
  23. l.Receive(ctx)
  24. }
  25. }