Giter Site home page Giter Site logo

kittyhawkmq's Introduction

KittyHawk MQTT .NET Library

A .NET implementation of the MQTT protocol. The library was designed to run across several platforms by creating abstractions around platform dependent functionality. Most of the source code is shared across the different projects with only the implementations of these abstractions being different. Documentation for using the library can be found here.

System Requirements

The project was built using Visual Studio 2013 update 4 and Windows 8.1 OS. The latest version of .NET Microframework must also be installed. The iOS project requires Xamarin.

Project Layout

  • MqttLib - Contains Win32, WinRT(PCL) and iOS(Xamarin) projects.
  • MqttLibMf42 - Contains the .NET Microframework v4.2 project.
  • MqttLibPhone8 - Contains the Windows Phone 8 project.
  • MqttLib_Tests - Units test run against the Win32 version of the source code.

All build output goes into (Solution Folder)\bin\(Platform Folder)

Platform Abstractions

These are the main abstraction points for platform specific implementations:

  • \Net(PlatformName)SocketAdapter.cs - Implements the ISocketAdapter for each platform. See \Interfaces\ISocketAdapter.cs for more information on the interface calls.
  • \Client\Mqtt(PlatformName)Client.cs - Implements the top-level MqttClient client interface for each platform.
  • \Settings\Mqtt(PlatformName)Settings.cs - Implements any unique settings required for each platform.

Platform Initialization

Each project is built with its own version of an MqttClient implementation. These classes have a public static method named CreateClient (or CreateSecureClient) that creates an MqttClient instance instantiated with the appropriate ISockectAdapter concrete class.

Also, each platform has its own class called MqttPlatformSettings, derived from a common MqttSettings class. The MqttSettings base class has common settings for all platforms. The derived class can override any of these settings within its own MqttPlatformSettings implementation for the specific need of that platform.

Whirlwind Tour of the Source Code

AssemblyCommon.cs & \Properties\AssemblyInfo.cs

AssemblyCommon.cs contains all assembly attributes common to all projects. Each project has its own version of AssemblyInfo.cs.

\Client

Contains the MqttClient implementation for the platform. ActiveClientCollection keeps track of clients attached to the library. Currently, it only supports 1 active client at a time. SubscriptionClient tracks all active subscriptions for a client.

\Collections

Due to differences in collection implementations across the platforms, and to keep dependencies at a minimum, these classes implement some basic collections needed by the library.

\Exceptions

A few custom exceptions used by the library.

\Interfaces

Most of the interfaces used by the library are located here.

\Messages

Mqtt message implementations.

\Net

Network and protocol implementations. In here are the platform specific implementations of ISocketAdapter.

\Plugins

An early attempt at a poor man's plugin interface. Currently only logging is implemented through the plugin feature.

\Settings

All settings related to the protocol or platform.

\Utilities

Some basic functions needed throughout the library. Data validators, encoders/decoders, timers, etc.

kittyhawkmq's People

Contributors

mfourlabs avatar jamckelvey avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.