I really can not see the problems with an initial attempt:
Code:
RSocketServ serv;
serv.Connect();
RSocket sock;
sock.Open(serv,KAfInet, KSockStream, KProtocolInetTcp);
TInetAddr addr(KInetAddrLoop,5222);
TRequestStatus stat;
sock.Connect(addr,stat);
User::WaitForRequest(stat);
console->Printf(_L("Connect status: %d\n"),stat.Int());
and you are connected.
Then according to 4.8 (http://xmpp.org/rfcs/rfc3920.html#streams)
Code:
_LIT8(KStart8,"<?xml version='1.0'?>\
<stream:stream\
to='servername'\
xmlns='jabber:client'\
xmlns:stream='http://etherx.jabber.org/streams'\
version='1.0'>");
sock.Write(KStart8(),stat);
User::WaitForRequest(stat);
console->Printf(_L("Write status: %d\n"),stat.Int());
TBuf8<100> buf8;
sock.Read(buf);
User::WaitForRequest(stat);
console->Printf(_L("Read status: %d\n"),stat.Int());
TBuf<100> buf;
buf.Copy(buf8);
console->Printf(buf);
and you have started the client stream and received the first 100 bytes of the response.
servername should match the name set for your OpenFire server
It is a console-based fragment where error handling is completely removed - though status codes are reported.