std::string buffer = "<?xml version='1.0'?><stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' to='gmail.com'>";
Poco::AutoPtr<Poco::Net::SecureStreamSocketImpl> socket(new Poco::Net::SecureStreamSocketImpl);
try
{
socket->connect(Poco::Net::SocketAddress("talk.google.com", 5223));
Poco::Thread::sleep(1000);
int sent = socket->sendBytes(buffer.c_str(), int(buffer.size()));
Poco::Thread::sleep(1000);
char buf[1024];
int got = socket->receiveBytes(buf, 1023);
Poco::Thread::sleep(1000);
buffer = "<iq id='auth1' type='get' to='gmail.com'><query xmlns='jabber:iq:auth'><username>nouncer</username></query></iq>";
sent = socket->sendBytes(buffer.c_str(), int(buffer.size()));
Poco::Thread::sleep(1000);
got = socket->receiveBytes(buf, 1023);
Poco::Thread::sleep(1000);
}
catch (Poco::Exception& exc)
{
std::cout << exc.displayText());
}
But changing to connectNB blows up. Any ideas?
EHL





