udp in bg thread

This commit is contained in:
bel
2023-03-24 21:02:47 -06:00
parent 2af373aed7
commit aa16b66332
2 changed files with 26 additions and 13 deletions

View File

@@ -16,7 +16,7 @@ func New(ctx context.Context) Raw {
return NewKeyboard()
}
if port, _ := strconv.Atoi(os.Getenv("RAW_UDP")); port != 0 {
return NewUDP(port)
return NewUDP(ctx, port)
}
generator := randomCharFromRange('a', 'g')
if p, ok := os.LookupEnv("RAW_RANDOM_WEIGHT_FILE"); ok && len(p) > 0 {