func (c *Client) Connect(s *Server) error {
	// connect
	var conn net.Conn
	var err error

	if s.Conn.IsTLS {
		conn, err = tls.Dial("tcp", s.Conn.Address, nil)
	} else {
		conn, err = net.Dial("tcp", s.Conn.Address)
	}
	if err != nil {
		log.Fatal("Could not connect:", err.Error())
		return err
	}

	// create socket
	socket := NewSocket(conn)
	c.Socket = &socket

	return nil
}
// Connect connects to the given server
Connect connects to the given server
// Connect connects to the given server
func (c *Client) Connect(s *Server) error {
	var conn net.Conn
	var err error
	if s.Conn.IsTLS {
		conn, err = tls.Dial("tcp", s.Conn.Address, nil)
	} else {
		conn, err = net.Dial("tcp", s.Conn.Address)
	}
	if err != nil {
		log.Fatal("Could not connect:", err.Error())
		return err
	}
	socket := NewSocket(conn)
	c.Socket = &socket
	return nil
}
func ( c * Client ) Connect ( s * Server ) error { var conn net . Conn var err error if s . Conn . IsTLS { conn , err = tls . Dial ( " " , s . Conn . Address , nil ) } else { conn , err = net . Dial ( " " , s . Conn . Address ) } if err != nil { log . Fatal ( " " , err . Error ( ) ) return err } socket := NewSocket ( conn ) c . Socket = & socket return nil }
Connect connects to the given server
Connect connects to the given server
// connect // create socket