This commit is contained in:
basil 2025-06-17 00:47:00 -04:00
parent a6ef3bf1b6
commit f174c4e02d
Signed by: basil
SSH key fingerprint: SHA256:y04xIFL/yqNaG9ae9Vl95vELtHfApGAIoOGLeVLP/fE
14 changed files with 626 additions and 1 deletions

32
x/smoketest/server.go Normal file
View file

@ -0,0 +1,32 @@
package smoketest
import (
"bytes"
"io"
"net"
)
func handleConn(conn net.Conn) error {
buf := &bytes.Buffer{}
_, err := buf.ReadFrom(conn)
if err != nil {
return err
}
_, err = io.Copy(conn, buf)
if err != nil {
return err
}
return nil
}
func New(listener net.Listener) error {
for {
conn, err := listener.Accept()
if err == nil {
go handleConn(conn)
}
}
}