Solved

Net-XMPP / Google Talk

Posted on 2007-03-28
5
1,517 Views
Last Modified: 2012-06-21
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
Comment
Question by:soapergem
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 8

Expert Comment

by:nedfine
ID: 18814065
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
 
LVL 6

Author Comment

by:soapergem
ID: 18930120
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
 
LVL 3

Accepted Solution

by:
javanesevn earned 500 total points
ID: 26569304
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question