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

main.go 734 B

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package main
  2. import (
  3. //"context"
  4. // "log"
  5. // "os"
  6. // "io"
  7. // "fmt"
  8. // "path/filepath"
  9. "net"
  10. agentserver "proto"
  11. "sync"
  12. "google.golang.org/grpc"
  13. )
  14. const (
  15. Port = ":5010"
  16. packetSizeInBytes = 10
  17. LocalIp = "localhost"
  18. )
  19. var AgentIpList []string
  20. func main() {
  21. AgentIpList = []string{"pcm01", "pcm1", "pcm2"}
  22. //处置协调端、客户端命令(可多建几个)
  23. wg := sync.WaitGroup{}
  24. wg.Add(2)
  25. go commandHandle(&wg)
  26. go heartReport(&wg) //网络延迟感知
  27. //面向客户端收发数据
  28. lis, err := net.Listen("tcp", Port)
  29. if err != nil {
  30. panic(err)
  31. }
  32. s := grpc.NewServer()
  33. agentserver.RegisterTranBlockOrReplicaServer(s, &anyOne{})
  34. s.Serve(lis)
  35. wg.Wait()
  36. //
  37. }

本项目旨在将云际存储公共基础设施化,使个人及企业可低门槛使用高效的云际存储服务(安装开箱即用云际存储客户端即可,无需关注其他组件的部署),同时支持用户灵活便捷定制云际存储的功能细节。

Contributors (1)