Check for errors in component connect.
This commit is contained in:
parent
e54260ec68
commit
b3a6429e0e
|
@ -2,6 +2,7 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"log"
|
||||||
|
|
||||||
"gosrc.io/xmpp"
|
"gosrc.io/xmpp"
|
||||||
)
|
)
|
||||||
|
@ -9,7 +10,9 @@ import (
|
||||||
func main() {
|
func main() {
|
||||||
component := MyComponent{Name: "Test Component", Category: "gateway", Type: "service"}
|
component := MyComponent{Name: "Test Component", Category: "gateway", Type: "service"}
|
||||||
component.xmpp = &xmpp.Component{Host: "service.localhost", Secret: "mypass"}
|
component.xmpp = &xmpp.Component{Host: "service.localhost", Secret: "mypass"}
|
||||||
_ = component.xmpp.Connect("localhost:8888")
|
if err := component.xmpp.Connect("localhost:8888"); err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
for {
|
for {
|
||||||
packet, err := component.xmpp.ReadPacket()
|
packet, err := component.xmpp.ReadPacket()
|
||||||
|
|
Loading…
Reference in a new issue