examples/chat: Use new listen/dial API
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user