Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
cml #1
Member since Oct 2005 · 15 posts
Group memberships: Members
Show profile · Link to this post
Subject: How to use IQ to list the rosters?
:oops: Dear manager:
My english is poor so I bag your forgiveness at first and hope you could understand what i say.

first question:
I would like to know that how could a client get his own roster informations
 from server which build by the sample this forum offer.
PS.I saw the hint that ask me to build a database or some kind of directory (LDAP, AD etc...) but I want to know more about that.

second question:
When I used the stop server button to eliminate the service, it always occured exception in the "client.Close()" function.I also want to know that.

thanks for your attention~ :D
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hi,

I wrote the server sample very fast. So the socket code is not perfect.
This sample sends only a dummy roster. In a real server the roster comes from a database, LDAP directory, active directory or smth else like you mentioned. That depends on your server.
The server has to handle all the roster stuff (add rosteritems, remove rosteritems, send the entire roster etc...).
Did you try the latest samples? Some minutes ago i uploaded new samples and the latest library. You should get exceptions there.

Alex
Avatar
cml #3
Member since Oct 2005 · 15 posts
Group memberships: Members
Show profile · Link to this post
:lol: thanks for your answer ~ I will try to understand it
Avatar
Alex #4
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
dont hesitate to ask here if you have problems.

Alex
Avatar
cml #5
Member since Oct 2005 · 15 posts
Group memberships: Members
Show profile · Link to this post
sorry, I will reform the bad habbit. :red:
1.
I would like to know the meaning of the abbreviation "IQ".
2.
http://www.ag-software.net/index.php?option=content&ta…
This page present the way to connect to google talk server.
But this function
xmpp.ConnectServer = "talk.google.com"
is not exist
and
xmpp.Server = "gmail.com";
doesn't work.

thanks a lot~
Avatar
Alex #6
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
When your library version has no ConnectServer property then you are using  a old version. Please checkout the latest version from the download section of the webpages or SVN.
IQ stands for InfoQuery. The XMPP Protocol supports 3 stanzas, message, presence and iq.
presence is used for broadcasting presence.
message is used for sending messages (e.g. a chat messages, email messages, etc...)
iq is used for the rest, for example fetching the roster from the server, or manipulating the own roster.

Alex
Avatar
zgc #7
Member since Oct 2005 · 4 posts
Group memberships: Members
Show profile · Link to this post
Subject: how to get my rosters's status of online/offline
:oops: dear manger!
my english is poor,hope you can understand me!
I build a database to store users information.

but how can i get contacts's status of online or offline?

 i  manipulate a users list that  fetched from database.

i send stored contacts infromations to the user who  request rosters items.

i change roster's status , when a client successed establish a session with server, at the same time i change the roster'status set  value to 'online'  associated to current user's avaliable resource in the list , also
 send presence prob to all contacts associated to this user in order to determine if they are avaliable such contacts are those for whick a JID is present in the user's roster with the 'subscription' attribute set to a value of 'to' or 'both'.

 i change the contact's status in the list, if his contacts succssed return presence information and also send presence information to initial client.

i hope your suggestions thanks a lot !
Avatar
Alex #8
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Subject: Re: how to get my rosters's status of online/offline
but how can i get contacts's status of online or offline?

 i  manipulate a users list that  fetched from database.

i send stored contacts infromations to the user who  request rosters items.
this is correct

i change roster's status , when a client successed establish a session with server, at the same time i change the roster'status set  value to 'online'  associated to current user's avaliable resource in the list , also
 send presence prob to all contacts associated to this user in order to determine if they are avaliable such contacts are those for whick a JID is present in the user's roster with the 'subscription' attribute set to a value of 'to' or 'both'.
you should wait here until the contact sends its own presence available or another presence to the server. Only when you get this presence send the presence to all subscribed contacts from this user. You dont have to send presence probe here. Probe is for server to server communications. This is when you want to know a presence from a contact which is not located on your server.
If a user sends the online presence to your server, or changes his presence, then lookup in your database all contacts that are allowed to see the presence (subscription = To or Both) of this user. When they are online then send a presence packet to this users. When they are not online do nothing.
Its the job of the server to send all the presences and not a job of the client. The client sends only his own presence to the server.

Alex
Avatar
zgc #9
Member since Oct 2005 · 4 posts
Group memberships: Members
Show profile · Link to this post
Subject: how to get my rosters's status of online/offline
alex thanks!
I am be suddenly enlightened after understand your reply!

thanks a lot!
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS