Retrieves the user's roster (contact list).
Namespace: S22.Xmpp.ClientAssembly: S22.Xmpp (in S22.Xmpp.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C# |
---|
public Roster GetRoster() |
Return Value
The user's roster.Remarks
In XMPP jargon, the user's contact list is called a
'roster'.
Examples
This example demonstrates how to use the GetRoster method in order
to retrieve a list of all of the user's contacts.
CopyC#
string hostname = "jabber.se", username = "myUsername", password = "myPassword"; using (var cl = new XmppClient(hostname, username, password)) { cl.Connect(); Console.WriteLine("Contacts on " + cl.Jid.Node + "'s contact-list:"); foreach (var item in cl.GetRoster()) Console.WriteLine(" - " + item.Jid); }
Exceptions
Exception | Condition |
---|---|
System.IO..::..IOException | There was a failure while writing to or reading from the network. |
System..::..InvalidOperationException | The XmppClient instance is not connected to a remote host, or the XmppClient instance has not authenticated with the XMPP server. |
System..::..ObjectDisposedException | The XmppClient object has been disposed. |
S22.Xmpp..::..XmppErrorException | The server returned an XMPP error code. Use the Error property of the XmppErrorException to obtain the specific error condition. |
S22.Xmpp..::..XmppException | The server returned invalid data or another unspecified XMPP error occurred. |