[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1531
  • Last Modified:

Net-XMPP / Google Talk

Could someone who knows Perl much better than I give me a code snippet that uses the Net-XMPP package to connect to Google Talk, send a message, and then disconnect? So far I haven't even been able to connect, let alone send a message. I've used the code shown below, but when I execute it, after a bit of waiting, it returns an error message: "No SASL mechanism found". Also, I understand well what the hostname, username, and password are, but what on earth is the "resource" parameter?

    #!/usr/local/bin/perl
    use Net::XMPP;
   
    $Con = new Net::XMPP::Client();
   
    $Con->Execute(hostname=>"talk.google.com",
        username=>"username@gmail.com",
        password=>"password",
        resource=>"i don't know what this means"
    );
   
    $Con->Disconnect();
0
soapergem
Asked:
soapergem
  • 2
1 Solution
 
nedfineCommented:
please ensure that the following modules are installed
IO ::Socket ::SSL (>=0.81 ?)
XML ::Stream
Net ::XMPP
Authen ::SASL

not too sure abt this.
0
 
soapergemAuthor Commented:
Those modules are installed. (Sorry for the delay in responding, by the way.) Now, about the question: what does the "resource" variable do? And how would I properly code something to send a message?
0
 
javanesevnCommented:
Hello Soapergem,

Gtalk is implemented XMPP protocol *BUT* they do customize from their own requirement.
So, if you would like to make a connection with their server please refer this rule http://code.google.com/apis/talk/open_communications.html

To help your make clear about resource  please read core protocol for more detail http://www.ietf.org/rfc/rfc3920.txt

Here is quick answer about resource. When you make a connection to xmpp server you should be set a resource or resource identifier to help server detect particular connection from client. Because from an account you can login to server by from other devices ( client application, mobile, web...etc), resource will help server routing traffic and delivery message.
You can set any name you like, if nothing is set some server will generate a random resource for client.

Regards,
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now