Skip to content

Commit

Permalink
2024-10-02 20:54:51
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanson committed Oct 2, 2024
1 parent 2b9d4ca commit 2e594fe
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion protocol/etch/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ import (
"github.com/mohanson/daze/lib/doa"
)

// Conf is acting as package level configuration.
var Conf = struct {
PayloadSize int
}{
PayloadSize: 508,
}

// Server implemented the etch protocol.
type Server struct {
Closer io.Closer
Expand Down Expand Up @@ -36,7 +43,7 @@ func (s *Server) Run() error {
log.Println("main: listen and serve on", s.Listen)

go func() {
buf := make([]byte, 512)
buf := make([]byte, Conf.PayloadSize)
for {
n, addr, err := conn.ReadFromUDP(buf)
if err != nil {
Expand Down

0 comments on commit 2e594fe

Please sign in to comment.