~samwhited/xmpp

299d6ccff48f9bffbb204a5155e0bff5512c47cb — Sam Whited 4 years ago ce8cade
Add Conn type to group methods in documentation
1 files changed, 7 insertions(+), 4 deletions(-)

M dial.go
M dial.go => dial.go +7 -4
@@ 13,6 13,9 @@ import (
	"mellium.im/xmpp/jid"
)

// Conn is a net.Conn created for the purpose of establishing an XMPP session.
type Conn net.Conn

// DialClient discovers and connects to the address on the named network with a
// client-to-server (c2s) connection.
//


@@ 27,7 30,7 @@ import (
// Network may be any of the network types supported by net.Dial, but you almost
// certainly want to use one of the tcp connection types ("tcp", "tcp4", or
// "tcp6").
func DialClient(ctx context.Context, network string, addr *jid.JID) (net.Conn, error) {
func DialClient(ctx context.Context, network string, addr *jid.JID) (Conn, error) {
	var d Dialer
	return d.Dial(ctx, network, addr)
}


@@ 36,7 39,7 @@ func DialClient(ctx context.Context, network string, addr *jid.JID) (net.Conn, e
// server-to-server connection (s2s).
//
// For more info see the DialClient function.
func DialServer(ctx context.Context, network string, addr *jid.JID) (net.Conn, error) {
func DialServer(ctx context.Context, network string, addr *jid.JID) (Conn, error) {
	d := Dialer{
		S2S: true,
	}


@@ 63,11 66,11 @@ type Dialer struct {
// Dial discovers and connects to the address on the named network.
//
// For a description of the arguments see the DialClient function.
func (d *Dialer) Dial(ctx context.Context, network string, addr *jid.JID) (net.Conn, error) {
func (d *Dialer) Dial(ctx context.Context, network string, addr *jid.JID) (Conn, error) {
	return d.dial(ctx, network, addr)
}

func (d *Dialer) dial(ctx context.Context, network string, addr *jid.JID) (net.Conn, error) {
func (d *Dialer) dial(ctx context.Context, network string, addr *jid.JID) (Conn, error) {
	if d.NoLookup {
		p, err := lookupPort(network, connType(d.S2S))
		if err != nil {