examples/chat: Use new listen/dial API

This commit is contained in:
2025-10-20 17:59:51 -04:00
parent c9480ba016
commit 2e4c693174
2 changed files with 6 additions and 9 deletions

View File

@@ -28,7 +28,7 @@ func main() {
func host(address string, certPath, keyPath string) error {
keyPair, err := tls.LoadX509KeyPair(certPath, keyPath)
if err != nil { return err }
listener, err := hopp.ListenTLS("tcp", address, &tls.Config {
listener, err := hopp.Listen("tls", address, &tls.Config {
InsecureSkipVerify: true,
Certificates: []tls.Certificate { keyPair },
})
@@ -60,11 +60,11 @@ func (this *client) run() {
for {
log.Println("accepting transaction")
trans, err := this.conn.AcceptTrans()
log.Println("accepted transaction")
if err != nil {
log.Printf("XXX %v failed: %v", this.conn.RemoteAddr(), err)
return
}
log.Println("accepted transaction")
go this.runTrans(trans)
}
}