Solved

Net-XMPP / Google Talk

Posted on 2007-03-28
5
1,512 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 8

Expert Comment

by:nedfine
ID: 18930541
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

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
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…

730 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