mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2025-10-22 12:35:36 -07:00
Move address into transport config
This makes it possible to use a factory function to create a transport of the right type and not having to repeat the address when calling Transport.Connect()
This commit is contained in:

committed by
Mickaël Rémond

parent
f8d0e99696
commit
7fa4b06705
@@ -14,10 +14,10 @@ type XMPPTransport struct {
|
||||
conn net.Conn
|
||||
}
|
||||
|
||||
func (t *XMPPTransport) Connect(address string) error {
|
||||
func (t *XMPPTransport) Connect() error {
|
||||
var err error
|
||||
|
||||
t.conn, err = net.DialTimeout("tcp", address, time.Duration(t.Config.ConnectTimeout)*time.Second)
|
||||
t.conn, err = net.DialTimeout("tcp", t.Config.Address, time.Duration(t.Config.ConnectTimeout)*time.Second)
|
||||
return err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user