Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8221947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:06:36+00:00 2026-06-07T14:06:36+00:00

I have been trying to get the PCP LibJingle example to work for several

  • 0

I have been trying to get the PCP LibJingle example to work for several days now. After working out all of the compilation and running errors, I have now run into an error that I have no previous experience with.

When running the program either as the sender or receiver the program gets a 503 “service-unavailable” error and terminates the program, but running as the server works just fine. I know that the standard is that 5xx means a server side error, so I looked at the program output line by line (provided at the end). From my near zero experience with servers and LibJingle, the best that I can figure is that either (or both) of the following are causing the 503:

  1. Google has disabled the necessary services for the LibJingle pcp example.
  2. The priority status = -1 (from what I could figure, means client unavailable).

I have logged into both of the Google accounts so that they are not offline/unavailable, and the LibJingle programs reflect this. However, as soon as the PCP example runs, the priority is set back to -1. I have also noticed that most, if not all, of the Google links in the program output are 404.

My questions:

  • Are these theories anywhere close to what maybe/is happening?
  • What do I need to do to fix this?
  • I have heard that it is possible to use a server (other than Google’s servers) to run the program through. Is this true? If so, where would I go to look into this?

Thank you, in advance, for the help.
–KMC

P.S. In the provided program output, I am attempting to send a file from forge…1@gmail.com to forge…2@gmail.com. I have censored some things and tried to cut down on other bits. But, not knowing for sure what may or may not be relevant, I did not do much cutting. If a mod or someone else that knows what maybe relevant and wants to edit it down, please feel free to do so.

forgefour@forgefour-ubuntu:~/Desktop$ ./LibJingle_Install/libjingle-0.6.13/talk/build/dbg/staging/pcp forge..1@gmail.com call_main.pdf forge..2@gmail.com/pcp8B13E6B8:outputmainadobe.pdf
Directory: /home/forgefour/Desktop
Password: 
connecting...
[002:406] OpenSSLAdapter::OnConnectEvent
[002:406] SEND >>>>>>>>>>>>>>>>>>>>>>>>> : Mon Jun 25 17:09:17 2012
[002:406]    <stream:stream to="gmail.com" xml:lang="*" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client">
logging in...
[002:446] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:17 2012
[002:446]    <stream:stream from="gmail.com" id="00B7404A40B94AA0" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client">
[002:447] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:17 2012
[002:447]    <stream:features>
[002:447]      <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls">
[002:447]        <required/>
[002:447]      </starttls>
[002:447]      <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
[002:447]        <mechanism>
[002:447]          X-GOOGLE-TOKEN
[002:447]        </mechanism>
[002:447]        <mechanism>
[002:447]          X-OAUTH2
[002:447]        </mechanism>
[002:447]      </mechanisms>
[002:447]    </stream:features>
[002:447] SEND >>>>>>>>>>>>>>>>>>>>>>>>> : Mon Jun 25 17:09:17 2012
[002:447]    <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
[002:488] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:17 2012
[002:488]    <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
[002:488] BeginSSL: gmail.com
[002:488] ContinueSSL
[002:488] SSL_connect:before/connect initialization
[002:489] SSL_connect:SSLv3 write client hello A
[002:489] SSL_connect:error in SSLv3 read server hello A
[002:489]  -- error want read
[002:489] SEND >>>>>>>>>>>>>>>>>>>>>>>>> : Mon Jun 25 17:09:17 2012
[002:489]    <stream:stream to="gmail.com" xml:lang="*" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client">
[002:530] ContinueSSL
[002:530] SSL_connect:error in SSLv3 read server hello A
[002:530]  -- error want read
[002:531] ContinueSSL
[002:531] SSL_connect:SSLv3 read server hello A
[002:531] SSL_connect:SSLv3 read server certificate A
[002:531] SSL_connect:SSLv3 read server done A
[002:531] SSL_connect:SSLv3 write client key exchange A
[002:532] SSL_connect:SSLv3 write change cipher spec A
[002:532] SSL_connect:SSLv3 write finished A
[002:532] SSL_connect:SSLv3 flush data
[002:532] SSL_connect:error in SSLv3 read finished A
[002:532]  -- error want read
[002:575] ContinueSSL
[002:575] SSL_connect:SSLv3 read finished A
[002:575]  -- success
[002:575] Certificate from server:
[002:575]         Version: 3 (0x2)
        Serial Number:31:fa:c7:51:00:00:00:00:5b:30
    Signature Algorithm: sha1WithRSAEncryption
        Issuer: C=US, O=Google Inc, CN=Google Internet Authority
        Validity
            Not Before: Jun  5 00:52:14 2012 GMT
            Not After : Jun  5 01:02:14 2013 GMT
        Subject: C=US, ST=California, L=Mountain View, O=Google Inc, CN=gmail.com
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
                Public-Key: (1024 bit)
                Modulus:...
                Exponent: 65537 (0x10001)
        X509v3 extensions:
            X509v3 Extended Key Usage: 
                TLS Web Server Authentication, TLS Web Client Authentication
            X509v3 Subject Key Identifier: 
                E1:73:4D:BB:F5:22:C3:57:06:EA:BF:18:73:1F:91:29:EE:54:2A:17
            X509v3 Authority Key Identifier: 
                keyid:BF:C0:30:EB:F5:43:11:3E:67:BA:9E:91:FB:FC:6A:DA:E3:6B:12:24
            X509v3 CRL Distribution Points: 
                Full Name:URI:http://www.gstatic.com/GoogleInternetAuthority/GoogleInternetAuthority.crl
            Authority Information Access: 
                CA Issuers - URI:http://www.gstatic.com/GoogleInternetAuthority/GoogleInternetAuthority.crt
            X509v3 Subject Alternative Name: DNS:gmail.com
    Signature Algorithm: sha1WithRSAEncryption...
[002:575] Cipher: AES128-SHA SSLv3 Kx=RSA Au=RSA  Enc=AES(128)  Mac=SHA1
[002:616] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012
[002:616]    <stream:stream from="gmail.com" id="F585A9BF4936FE0D" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client">
[002:616] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012
[002:616]    <stream:features>
[002:616]      <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
[002:616]        <mechanism>
[002:616]          PLAIN
[002:616]        </mechanism>
[002:616]        <mechanism>
[002:616]          X-GOOGLE-TOKEN
[002:616]        </mechanism>
[002:616]        <mechanism>
[002:616]          X-OAUTH2
[002:616]        </mechanism>
[002:616]      </mechanisms>
[002:616]    </stream:features>
[002:617] SEND >>>>>>>>>>>>>>>>>>>>>>>>> : Mon Jun 25 17:09:18 2012
[002:617]    <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="PLAIN" auth:allow-non-google-login="true" auth:client-uses-full-bind-result="true" xmlns:auth="http://www.google.com/talk/protocol/auth">
[002:617]      ## TEXT REMOVED ##
[002:617]    </auth>
[002:696] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012
[002:696]    <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/>
[002:697] SEND >>>>>>>>>>>>>>>>>>>>>>>>> : Mon Jun 25 17:09:18 2012
[002:697]    <stream:stream to="gmail.com" xml:lang="*" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client">
[002:737] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012
[002:737]    <stream:stream from="gmail.com" id="A554FE81E66DED32" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client">
[002:737] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012
[002:737]    <stream:features>
[002:737]      <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/>
[002:737]      <session xmlns="urn:ietf:params:xml:ns:xmpp-session"/>
[002:737]    </stream:features>
[002:737] SEND >>>>>>>>>>>>>>>>>>>>>>>>> : Mon Jun 25 17:09:18 2012  
[002:737]    <iq type="set" id="0">
[002:737]      <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
[002:737]        <resource>
[002:737]          pcp
[002:737]        </resource>
[002:737]      </bind>
[002:737]    </iq>
[002:777] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012
[002:777]    <iq id="0" type="result">
[002:777]      <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
[002:777]        <jid>
[002:777]          forge...1@gmail.com/pcp7B23909E
[002:777]        </jid>
[002:777]      </bind>
[002:777]    </iq>
[002:777] SEND >>>>>>>>>>>>>>>>>>>>>>>>> : Mon Jun 25 17:09:18 2012
[002:777]    <iq type="set" id="1">
[002:777]      <session xmlns="urn:ietf:params:xml:ns:xmpp-session"/>
[002:777]    </iq>
[002:778] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012
[002:817] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012  
[002:817]    <iq type="result" id="1"/>
logged in...
[002:817] SEND >>>>>>>>>>>>>>>>>>>>>>>>> : Mon Jun 25 17:09:18 2012
[002:817]    <presence>
[002:817]      <priority>
[002:817]        -1
[002:817]      </priority>
[002:817]    </presence>
Logged in as forge...1@gmail.com/pcp7B23909E
[002:817] Making key pair
[002:822] Returning key pair
[002:822] Making certificate for forge...1@gmail.com/pcp7B23909E
[002:823] Returning certificate
[002:823] TunnelSessionClientBase::OnSessionCreate: received=0
[002:823] Session:2481285798 Old state:STATE_INIT New state:STATE_SENTINITIATE Type:http://www.google.com/talk/securetunnel Transport:http://www.google.com/transport/p2p
[002:823] TunnelSession::OnSessionState(Session::STATE_SENTINITIATE)
[002:823] SEND >>>>>>>>>>>>>>>>>>>>>>>>> : Mon Jun 25 17:09:18 2012
[002:823]    <iq type="get" id="3">
[002:823]      <query xmlns="google:jingleinfo"/>
[002:823]    </iq>
[002:823] SEND >>>>>>>>>>>>>>>>>>>>>>>>> : Mon Jun 25 17:09:18 2012
[002:823]    <iq to="forge...2@gmail.com/pcp8B13E6B8" type="set" id="5">
[002:823]      <jingle xmlns="urn:xmpp:jingle:1" action="session-initiate" sid="2481285798" initiator="forge...1@gmail.com/pcp7B23909E">
[002:823]        <content name="securetunnel" creator="initiator">
[002:823]          <description xmlns="http://www.google.com/talk/securetunnel">
[002:823]            <type>
[002:823]              recv:outputmainadobe.pdf
[002:823]            </type>
[002:823]            <client-cert>
[002:823]              -----BEGIN CERTIFICATE-----...-----END CERTIFICATE-----
[002:823]            </client-cert>
[002:823]          </description>
[002:823]          <transport xmlns="http://www.google.com/transport/p2p"/>
[002:823]        </content>
[002:823]      </jingle>
[002:823]      <session xmlns="http://www.google.com/session" type="initiate" id="2481285798" initiator="forge...1@gmail.com/pcp7B23909E">
[002:823]        <description xmlns="http://www.google.com/talk/securetunnel">
[002:823]          <type>
[002:823]            recv:outputmainadobe.pdf
[002:823]          </type>
[002:823]          <client-cert>
[002:823]            -----BEGIN CERTIFICATE-----...-----END CERTIFICATE-----
[002:823]          </client-cert>
[002:823]        </description>
[002:823]      </session>
[002:823]    </iq>
[002:867] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012
[002:867]    <iq to="forge...1@gmail.com/pcp7B23909E" id="3" type="result">
[002:867]      <query xmlns="google:jingleinfo">
[002:867]        <stun>
[002:867]          <server host="stun.l.google.com" udp="19302"/>
[002:867]          <server host="alt3.stun.l.google.com" udp="19302"/>
[002:867]          <server host="alt2.stun.l.google.com" udp="19302"/>
[002:867]          <server host="alt4.stun.l.google.com" udp="19302"/>
[002:867]          <server host="alt1.stun.l.google.com" udp="19302"/>
[002:867]        </stun>
[002:867]        <relay>
[002:867]          <token>
[002:867]            CAESHgoVZm9yZ2Vjb21tczFAZ21haWwuY29tEJXfqb2CJxoQy4rGyFRtv1QQGHf8AQWC0A==
[002:867]          </token>
[002:867]          <server host="relay.google.com" udp="19295" tcp="19294" tcpssl="443"/>
[002:867]        </relay>
[002:867]      </query>
[002:867]    </iq>
[002:880] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012
[002:880]    <presence from="forge...1@gmail.com/pcp0C32AC91" to="forge...1@gmail.com/pcp7B23909E">
[002:880]      <priority>
[002:880]        -1
[002:880]      </priority>
[002:880]      <x xmlns="vcard-temp:x:update"/>
[002:880]    </presence>
[002:880] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012
[002:882] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012   
[002:882]    <presence from="cu...@gmail.com/gmail.17841843" to="forge...1@gmail.com/pcp7B23909E">
[002:882]      <status/>
[002:882]      <priority>
[002:882]        24
[002:882]      </priority>
[002:882]      <caps:c node="http://mail.google.com/xmpp/client/caps" ver="1.1" ext="pmuc-v1 sms-v1 camera-v1 video-v1 voice-v1" xmlns:caps="http://jabber.org/protocol/caps"/>
[002:882]      <x xmlns="vcard-temp:x:update">
[002:882]        <photo>
[002:882]          c632207e8c5c202147ccbd6c431334234750f966
[002:882]        </photo>
[002:882]      </x>
[002:882]    </presence>
[002:956] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012
[002:956]    <iq to="forge...1@gmail.com/pcp7B23909E" type="error" id="5" from="forge...2@gmail.com/pcp8B13E6B8">
[002:956]      <jingle action="session-initiate" sid="2481285798" initiator="forge...1@gmail.com/pcp7B23909E" xmlns="urn:xmpp:jingle:1">
[002:956]        <content name="securetunnel" creator="initiator">
[002:956]          <description xmlns="http://www.google.com/talk/securetunnel">
[002:956]            <type>
[002:956]              recv:outputmainadobe.pdf
[002:956]            </type>
[002:956]            <client-cert>
[002:956] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012
[002:956]    -----BEGIN CERTIFICATE-----...-----END CERTIFICATE-----
[002:956]  </client-cert>
[002:956]  </description>
[002:956]  <transport xmlns="http://www.google.com/transport/p2p"/>
[002:956]  </content>
[002:956]  </jingle>
[002:956]  <session type="initiate" id="2481285798" initiator="forge...1@gmail.com/pcp7B23909E" xmlns="http://www.google.com/session">
[002:956]  <description xmlns="http://www.google.com/talk/securetunnel">
[002:956]  <type>
[002:956]  recv:outputmainadobe.pdf
[002:956]  </type>
[002:956]  <client-cert>
[002:956] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012
[002:956]    -----BEGIN CERTIFICATE-----...-----END CERTIFICATE-----
[002:956]  </client-cert>
[002:956]  </description>
[002:956]  </session>
[002:956]  <error code="503" type="cancel">
[002:956]  <service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
[002:956]  </error>
[002:956]  </iq>
[002:957] Error(session.cc:858): Session error:
<cli:error code="503" type="cancel" xmlns:cli="jabber:client"><service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></cli:error>
in response to:
<cli:iq to="forge...2@gmail.com/pcp8B13E6B8" type="set" id="5" xmlns:cli="jabber:client"><jingle xmlns="urn:xmpp:jingle:1" action="session-initiate" sid="2481285798" initiator="forge.1@gmail.com/pcp7B23909E"><content name="securetunnel" creator="initiator"><description xmlns="http://www.google.com/talk/securetunnel"><type>recv:outputmainadobe.pdf</type><client-cert>-----BEGIN CERTIFICATE-----...-----END CERTIFICATE-----
</client-cert></description><transport xmlns="http://www.google.com/transport/p2p"/></content></jingle><session xmlns="http://www.google.com/session" type="initiate" id="2481285798" initiator="forge...1@gmail.com/pcp7B23909E"><description xmlns="http://www.google.com/talk/securetunnel"><type>recv:outputmainadobe.pdf</type><client-cert>-----BEGIN CERTIFICATE-----...----END CERTIFICATE-----
</client-cert></description></session></cli:iq>
[002:957] Session:2481285798 Old state:STATE_SENTINITIATE New state:STATE_SENTTERMINATE Type:http://www.google.com/talk/securetunnel Transport:http://www.google.com/transport/p2p
[002:957] TunnelSession::OnSessionState(Session::STATE_SENTTERMINATE)
[002:957] Destroying unconnected PseudoTcpChannel
[002:957] SEND >>>>>>>>>>>>>>>>>>>>>>>>> : Mon Jun 25 17:09:18 2012
[002:957]    <iq to="forge...2@gmail.com/pcp8B13E6B8" type="set" id="6">
[002:957]      <jingle xmlns="urn:xmpp:jingle:1" action="session-terminate" sid="2481285798">
[002:957]        <reason>
[002:957]          <general-error/>
[002:957]        </reason>
[002:957]      </jingle>
[002:957]      <session xmlns="http://www.google.com/session" type="terminate" id="2481285798" initiator="forge...1@gmail.com/pcp7B23909E">
[002:957]        <general-error/>
[002:957]      </session>
[002:957]    </iq>
[002:957] OpenSSLStreamAdapter::OnEvent(SE_CLOSE, -1)
[002:957] Cleanup
Tunnel closed with error: -1
[002:957] Cleanup
[002:957] TunnelSessionClientBase::OnSessionDestroy
[002:957] Session:2481285798 Old state:STATE_SENTTERMINATE New state:STATE_DEINIT Type:http://www.google.com/talk/securetunnel Transport:http://www.google.com/transport/p2p
[002:957] virtual void cricket::PseudoTcpChannel::OnMessage(talk_base::Message*): (MSG_SI_DESTROY)
[002:957] SEND >>>>>>>>>>>>>>>>>>>>>>>>> : Mon Jun 25 17:09:18 2012
[002:957]  </stream:stream>
logged out...
[002:957] Cleanup

EDIT: As requested I am including some of the code (I would include all of it, but the main file is 723 lines). I am still directly using Google’s LibJingle code, unmodified, as I have not yet been able to get this working. The full code for this file can be found here.

int main(int argc, char **argv) {
  talk_base::LogMessage::LogThreads();
  talk_base::LogMessage::LogTimestamps();

  // Parse the arguments.
  int index = 1;
  while (index < argc) {
    std::string name, value;
    if (!ParseArg(argv[index], &name, &value))
      break;

    if (name == "help") {
      Usage();
    } else if (name == "verbose") {
      talk_base::LogMessage::LogToDebug(talk_base::LS_VERBOSE);
    } else if (name == "xmpp-host") {
      gXmppHost = value;
    } else if (name == "xmpp-port") {
      gXmppPort = ParseIntArg(name, value);
    } else if (name == "xmpp-use-tls") {
      gXmppUseTls = ParseBoolArg(name, value)?
          buzz::TLS_REQUIRED : buzz::TLS_DISABLED;
    } else {
      Error(std::string("unknown option: ") + name);
    }
    index += 1;
  }

  if (index >= argc)
    Error("bad arguments");
  gUserJid = buzz::Jid(argv[index++]);
  if (!gUserJid.IsValid())
    Error("bad arguments");

  char path[MAX_PATH];
#if WIN32
  GetCurrentDirectoryA(MAX_PATH, path);
#else
  if (NULL == getcwd(path, MAX_PATH))
    Error("Unable to get current path");
#endif

  std::cout << "Directory: " << std::string(path) << std::endl;

  buzz::Jid gSrcJid;
  buzz::Jid gDstJid;
  std::string gSrcFile;
  std::string gDstFile;

  bool as_server = true;
  if (index + 2 == argc) {
    ParseFileArg(argv[index], &gSrcJid, &gSrcFile);
    ParseFileArg(argv[index+1], &gDstJid, &gDstFile);
    if(gSrcJid.Str().empty() == gDstJid.Str().empty())
      Error("Exactly one of source JID or destination JID must be empty.");
    as_server = false;
  } else if (index != argc) {
    Error("bad arguments");
  }

  std::cout << "Password: ";
  SetConsoleEcho(false);
  std::cin >> gUserPass.password();
  SetConsoleEcho(true);
  std::cout << std::endl;

  talk_base::InitializeSSL();
  CustomXmppPump pump;// Log in.
  pump.client()->SignalLogInput.connect(&debug_log_, &DebugLog::Input);
  pump.client()->SignalLogOutput.connect(&debug_log_, &DebugLog::Output);
  pump.DoLogin(LoginSettings(), new XmppSocket(gXmppUseTls), 0);

  // Wait until login succeeds.
  std::vector<uint32> ids;
  ids.push_back(MSG_LOGIN_COMPLETE);
  ids.push_back(MSG_LOGIN_FAILED);
  if (MSG_LOGIN_FAILED == Loop(ids))
    FatalError("Failed to connect");{
    talk_base::scoped_ptr<buzz::XmlElement> presence(
      new buzz::XmlElement(buzz::QN_PRESENCE));
    presence->AddElement(new buzz::XmlElement(buzz::QN_PRIORITY));
    presence->AddText("-1", 1);
    pump.SendStanza(presence.get());
  }

  std::string user_jid_str = pump.client()->jid().Str();
  std::cout << "Logged in as " << user_jid_str << std::endl;

  // Prepare the random number generator.
  talk_base::InitRandom(user_jid_str.c_str(), user_jid_str.size());

  // Create the P2P session manager.
  talk_base::BasicNetworkManager network_manager;
  AutoPortAllocator allocator(&network_manager, "pcp_agent");
  allocator.SetXmppClient(pump.client());
  cricket::SessionManager session_manager(&allocator);
#ifdef USE_SSL_TUNNEL
  cricket::SecureTunnelSessionClient session_client(pump.client()->jid(),
                                                    &session_manager);
  if (!session_client.GenerateIdentity())
    FatalError("Failed to generate SSL identity");
#else  // !USE_SSL_TUNNEL
  cricket::TunnelSessionClient session_client(pump.client()->jid(),
                                              &session_manager);
#endif  // USE_SSL_TUNNEL
  cricket::SessionManagerTask *receiver =
      new cricket::SessionManagerTask(pump.client(), &session_manager);
  receiver->EnableOutgoingMessages();
  receiver->Start();

  bool success = true;

  if (as_server) {// Establish the appropriate connection.
    pump.Serve(&session_client);
  } else {
    talk_base::StreamInterface* stream = NULL;
    std::string filename;
    bool sending;
    if (gSrcJid.Str().empty()) {
      std::string message("recv:");
      message.append(gDstFile);
      stream = session_client.CreateTunnel(gDstJid, message);
      filename = gSrcFile;
      sending = true;
    } else {
      std::string message("send:");
      message.append(gSrcFile);
      stream = session_client.CreateTunnel(gSrcJid, message);
      filename = gDstFile;
      sending = false;
    }
    success = pump.ProcessStream(stream, filename, sending);
  }

  if (success) {
    // Wait until the copy is done.
    ids.clear();
    ids.push_back(MSG_DONE);
    ids.push_back(MSG_LOGIN_FAILED);
    Loop(ids);
  }

  pump.DoDisconnect();// Log out.

  return 0;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T14:06:39+00:00Added an answer on June 7, 2026 at 2:06 pm

    Okay, so this error was because of the wrong full JID and wrong code execution. PCP should be run following the provided sequence:

    1. Run “./pcp receiveruser@host.com” and provide account password.
    2. Read the resulting full JID of receiveruser@host.com account provided in the code output. Easiest way, if possible, is to search for: “logged in as” in the output. Take the everything after the “.com/” in the user’s account informaiton.
    3. Run “./pcp senderuser@host.com send_file_name.extension receiveruser@host.com/(full JID):received_file_name.extension”

    This error was occurring because the method of code execution being used was preventing the account from being seen as available. It was nothing to do with a server error or a lack of Google service (sorry to have doubted you, Google). As for the priority being -1, this also had nothing to do with the error (as learned after reading up on XMPP).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to get QLabel.setText in PySide working for several days, but
I have been trying to get this to work for 12 hrs now and
I have been trying to get a2billing to work for the past 4 days
I have been trying to get this to work for about three solid days
I have been trying to get this working for quite a while now but
I have been trying to get C++11 to work, after browsing different websites and
I have been trying to get this to work with several tutorials/answers here, but
I have been trying to get this code to work for a while now
I have been trying to get Twitter Bootstrap btn-group with dropdown to work for
I have been trying to get nServiceBus to work with Ninject 2.0 as the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.