Skip to content

Commit

Permalink
Minor clean-up.
Browse files Browse the repository at this point in the history
  • Loading branch information
lthibault committed May 25, 2024
1 parent 843faf9 commit 444171d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions vat/vat.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
"log/slog"
"path/filepath"
"time"

"capnproto.org/go/capnp/v3"
Expand All @@ -28,18 +27,21 @@ type NetConfig struct {
}

func (c NetConfig) Proto() protocol.ID {
proto := filepath.Join(Proto, c.Guest.Name())
return protocol.ID(proto)
return ProtoFromModule(c.Guest)
}

func (c NetConfig) Build(ctx context.Context) Network {
if c.DialTimeout <= 0 {
c.DialTimeout = time.Second * 10
}

l := ListenConfig{
Host: c.Host,
}.Listen(ctx, c.Proto())

return Network{
NetConfig: c,
Listener: ListenConfig{Host: c.Host}.Listen(ctx, c.Proto()),
Listener: l,
}
}

Expand Down

0 comments on commit 444171d

Please sign in to comment.