patriksvensson / bayeux

A .NET implementation of the Bayeux client protocol targeting netstandard1.1.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bayeux

A .NET implementation of the Bayeux client protocol targeting netstandard1.1.

Example

using Bayeux;
using Bayeux.Diagnostics;

namespace Example
{
    public class Program
    {
        public static void Main(string[] args)
        {
            // Create the client settings.
            var endpoint = new Uri("http://localhost:8000/faye");
            var settings = new BayeuxClientSettings(endpoint)
            {
                Logger = new ConsoleLogger()
            };

            // Create the client.
            using (var client = new BayeuxClient(settings))
            {
                // Connect to server.
                client.Connect();

                // Subscribe to channel.
                client.Subscribe("/test", message => Console.WriteLine("Message received: {0}", message.Channel));

                // Wait for exit.
                Console.WriteLine("Press ANY key to quit.");
                Console.ReadKey(true);
            }
        }
    }
}

About

A .NET implementation of the Bayeux client protocol targeting netstandard1.1.

License:MIT License


Languages

Language:C# 83.8%Language:PowerShell 16.2%