orc.lib.net
Class XMPPConnection
java.lang.Object
orc.runtime.values.Value
orc.runtime.sites.Site
orc.runtime.sites.EvalSite
orc.lib.net.XMPPConnection
- All Implemented Interfaces:
- Callable, Future
public class XMPPConnection
- extends EvalSite
Orc support for the XMPP (Jabber, Google Talk) messaging protocol.
For the most part, the API follows that of Smack.
This example program should get you started:
var (user, pass) = ("USER", "PASS")
var talkto = "USER@gmail.com"
site XMPPConnection = orc.lib.net.XMPPConnection
val conn = XMPPConnection("talk.google.com", 5222, "gmail.com") >conn>
conn.connect() >>
conn.login(user, pass) >>
conn
conn.chat(talkto) >chat>
chat.send("Are you there?") >>
chat.receive()
WARNING: to talk to someone you must appear in their buddy list.
Currently you will have to handle this manually before trying to talk to them
using Orc.
I wish I could just use our Java sites to generate this automatically, but
there are a few methods in the API which require asynchronous behavior and so
must be implemented as Orc sites.
- Author:
- quark
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XMPPConnection
public XMPPConnection()
evaluate
public Value evaluate(Args args)
throws TokenException
- Specified by:
evaluate
in class EvalSite
- Throws:
TokenException