[cl-xmpp-devel] All calls return connection object

Adam Thorsen adam.thorsen at gmail.com
Fri Nov 11 01:39:28 UTC 2005


Erik, this is the code I use to initialize the connection, as is
suggested on common-lisp.net:

(require :cl-xmpp)

(defvar connection (xmpp:connect :hostname "jabber.loglibrary.com"))

;; initiate XML stream with server
(xmpp:begin-xml-stream connection)

;; authenticate (or use xmpp:register to make an account)
 (xmpp:auth connection "test" "whatever" "server")

;; let the server know you want to receive/send presence information
;; (this makes you "come online" if others have a subscription with
you
 (xmpp:presence connection)

I then execute this on the SLIME REPL:

CL-USER> (xmpp:message connection "awt at jabber.loglibrary.com" "what's
going on?")

However, I am still not recieving messages from test at jabber.loglibrary.com.

Is there some way I can find out what's happening?  Where the message
is getting lost or not transmitted?  Is there a simpler test I can
perform?

I swtiched (from the first email I sent) from SBCL 9.5 on OSX to SBCL
9.5 on Gentoo/x86 because I thought it might be a threading issue, but
no luck.

Thanks,
-Adam

On 11/10/05, Erik Enge <erik.enge at gmail.com> wrote:
> On 11/10/05, Adam Thorsen <adam.thorsen at gmail.com> wrote:
> > All subsequent calls to the API seem only to return the connection
> > object, and accomplish nothing:
>
> This is the intended behavior.  I would like to print the actual XML
> sent to the server but presently CXML doesn't allow me to do that
> easily without writing my own binary stream which converts to
> characters and prints to a secondary character stream (eg
> *standard-output*) like broadcast streams do.  I would welcome such a
> patch.
>
> I didn't see a call to xmpp:auth, was that just a slip or are you not
> calling it?
>
> According to the RFCs, if you are interested in presence information,
> the recommended order is auth -> presence -> any messaging.
>
> Also, I don't see a call to xmpp:begin-xml-stream.  This is required
> as the first thing you do after xmpp:connect.  A good client should
> also call xmpp:end-xml-stream before calling close on the connection
> object.
>
> > None of the above actually seem to work (the account's buddy icon
> > doesn't appear to come online, and no messages are recieved from it.)
>
> To receive replies from the server, try xmpp:receive-stanza-loop and
> see what it returns to you.
>
> * (defparameter *connection* (xmpp:connect :hostname "jabber.loglibrary.com"))
> *CONNECTION*
> * (xmpp:begin-xml-stream *connection*)
> "<stream:stream to='jabber.loglibrary.com'
> xmlns='jabber:client'
> xmlns:stream='http://etherx.jabber.org/streams'
> version='1.0'>"
> * (xmpp:receive-stanza-loop *connection*)
> Received: #<XML-ELEMENT STREAM:STREAM (4:0:0) {A9AF861}>
> Received: #<XML-ELEMENT STREAM:FEATURES (0:2:0) {B3AA159}>
>
> You can define xmpp:handle to get these replies programmatically, as
> shown in the README.
>
> Try these suggestions and let me know if you still can't get it to work.
>
> Thanks,
> Erik.
>



More information about the cl-xmpp-devel mailing list