Artalk.Xmpp 0.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Artalk.Xmpp --version 0.0.1
NuGet\Install-Package Artalk.Xmpp -Version 0.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Artalk.Xmpp" Version="0.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Artalk.Xmpp --version 0.0.1
#r "nuget: Artalk.Xmpp, 0.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Artalk.Xmpp as a Cake Addin
#addin nuget:?package=Artalk.Xmpp&version=0.0.1

// Install Artalk.Xmpp as a Cake Tool
#tool nuget:?package=Artalk.Xmpp&version=0.0.1

Introduction

Artalk Xmpp is an easy-to-use and well-documented .NET assembly for communicating with an XMPP server. It supports basic Instant Messaging and Presence funtionality as well as a variety of XMPP extensions.

Supported XMPP Features

The library fully implements the XMPP Core and XMPP Im specifications and thusly provides the basic XMPP instant messaging (IM) and presence functionality. In addition, the library offers support for most of the optional protocol extensions. More specifically, the following features are supported:

Where to get it

The project is hosted at GitHub and can be found at https://github.com/araditc/Artalk.Xmpp. You can always get the latest binary package on Nuget . The documentation is also available for offline viewing as HTML or CHM .

License

This library is released under the MIT License. It can be used in private and commercial projects.

Bug reports

Please send your bug reports to bugs@arad-itc.org or create a new issue on the GitHub project homepage.

About XMPP

This section provides a brief overview of the architecture of the Extensible Messaging and Presence Protocol (XMPP).

Collapse imageIntroduction

The Extensible Messaging and Presence Protocol (XMPP) is an open XML-based protocol for near-real-time messaging, presence, and request-response services.

The protocol was originally named Jabber, and was developed by the Jabber open-source community in 1999 for near real-time, instant messaging (IM), presence information, and contact list maintenance. Designed to be extensible, the protocol has also been used for publish-subscribe systems, signalling for VoIP, video, file transfer, gaming, Internet of Things applications such as the smart grid, and social networking services.

Collapse imageArchitecture

The XMPP network uses a client–server architecture (clients do not talk directly to one another). However, it is decentralized—by design, there is no central authoritative server, as there is with services such as AOL Instant Messenger or Windows Live Messenger.

Clients send and receive messages only to and from their respective server and it is the server's responsibility to route appropriately-addressed messages through the network to the intended user. For this purpose, every user on the network has a unique Jabber ID (usually abbreviated as JID ). To avoid requiring a central server to maintain a list of IDs, the JID is structured like an email address with a username and a domain name for the server where that user resides, separated by an at sign (@), such as username@example.com.

The following diagram provides a general overview of the XMPP architecture:

Xmpp

See Also

Other Resources

XMPP on Wikipedia

##Installation

This quick start shows you how to incorporate the َArtalk.Xmpp assembly into your application.

Getting up and running

  1. Add a reference to the Artalk.Xmpp assembly: Open your project in Visual Studio and, in Solution Explorer, right-click References, and then click Add Reference. Locate Artalk.Xmpp.dll and add it.
  2. You can now start using the namespaces exposed by the Artalk.Xmpp assembly.

Prerequisites

To complete this quick start, you must have the following components:

  1. Visual Studio 2003 or newer.
  2. A copy of the Artalk.Xmpp.dll assembly.

Getting Started

This section provides a brief overview of the different namespaces and classes exposed by the Artalk.Xmpp assembly.

Artalk.Xmpp.Core

The Artalk.Xmpp.Core namespace contains basic client-side components that provide a general framework for exchanging structured information in the form of XML data elements between any two network endpoints and correlates closely to the Extensible Messaging and Presence Protocol (XMPP): Core specification (RFC 3920).

As such, the classes of the Artalk.Xmpp.Core namespace provide building blocks for creating custom communication protocols based on the core XMPP concepts of XML streams and XML stanzas.

Artalk.Xmpp.Im

The Artalk.Xmpp.Im namespace contains components that implement the basic instant messaging (IM) and presence functionality defined in the Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence specification (RFC 3921).

In other words, Artalk.Xmpp.Im provides a lean "bare bones" XMPP client that implements the minimum feature set that is expected from a conforming implementation. It can be used in situations where a full-scale implementation with support for various XMPP protocol extensions is not neccessary, and can also be used as a basis for creating XMPP clients that implement only a select set of extensions.

Artalk.Xmpp.Client

The Artalk.Xmpp.Client namespace contains components that built on-top the classes of the Artalk.Xmpp.Im and the Artalk.Xmpp.Core namespaces to implement a feature-rich XMPP client.

Howto: Connect to an XMPP server

The following example demonstrates how to connect to an XMPP server using the ArtalkXmppClient class.

Connecting using an existing XMPP account

If you already have an account on the server to which you want to connect, establishing a connection is as easy as initializing a new instance of the ArtalkXmppClient class und calling the Connect method as demonstrated in the following example application:

C#

                               
using Artalk.Xmpp.Client;
using System;
using System.Text.RegularExpressions;
namespace ArtalkTest {
    class Program {
        static void Main(string[] args) {
            string hostname = "artalk.ir";
            string username = "myusername";
            string password = "mysecretpassword";
            using (ArtalkXmppClient client = new ArtalkXmppClient(hostname, username, password)) {
               // Setup any event handlers before connecting.
                    client.Message += OnNewMessage;
                    // Connect and authenticate with the server.

                client.Connect();
            }
        }
             /// <summary>
            /// Invoked whenever a new chat-message has been received.
            /// </summary>
            static void OnNewMessage(object sender, MessageEventArgs e) {
                Console.WriteLine("Message from <" + e.Jid + ">: " + e.Message.Body);
            }
    }
}

Send Message

client.SendMessage(recipient, message);

Using the constructor of the ArtalkXmppClient class as in the example above will automatically negotiate TLS/SSL encryption if the server supports it, however this behaviour can be disabled by passing the constructor a value of false for the tls parameter.

Product Compatible and additional computed target framework versions.
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.5 2,765 11/15/2022
1.0.3 12,598 7/30/2021
1.0.2 654 1/24/2021
0.0.1 852 11/14/2019

Summary of changes made in this release of the package.