internal/testutil: Add ConnRecorder which records net.Conn writes

This commit is contained in:
2025-11-19 13:10:26 -05:00
parent ad930144cf
commit 3136dcbfdf
3 changed files with 91 additions and 2 deletions

View File

@@ -57,9 +57,9 @@ func runTrans(conn hopp.Conn, trans hopp.Trans) {
return
}
switch message := message.(type) {
case *ping.MessagePing:
case ping.MessagePing:
log.Printf("--> ping (%d) from %v", message, conn.RemoteAddr())
response := ping.MessagePong(*message)
response := ping.MessagePong(message)
_, err := ping.Send(trans, &response)
if err != nil {
log.Printf("XXX failed to send message: %v", err)