Keeps component connection open

This commit is contained in:
Mickael Remond
2018-01-12 19:08:47 +01:00
parent b21fee420f
commit 24ac2c0526
4 changed files with 21 additions and 2 deletions

View File

@@ -1,8 +1,20 @@
package main
import "fluux.io/xmpp"
import (
"fmt"
"fluux.io/xmpp"
)
func main() {
component := xmpp.Component{Host: "mqtt.localhost", Secret: "mypass"}
component.Connect("localhost:8888")
for {
_, packet, err := component.ReadPacket()
if err != nil {
return
}
fmt.Println("Packet received: ", packet)
}
}