UDP client-server gem, with included reporter.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
examples
lib
test
.gitignore
.ruby-version
.travis.yml
CODE_OF_CONDUCT.md
Gemfile
LICENSE.txt
README.md
Rakefile
udipity.gemspec

README.md

Build Status Code Climate Test Coverage Dependency Status Inline docs

udipity

This is a library that provides two tools:

  • a server that accepts a specific set UDP commands
  • a client for sending UDP commands

Example

There are three files in the examples folder that show how a client, a server and a monitor could be implemented. The server and the monitor require a local Redis server.

In order to start them, clone the repository, run bin/setup then run the following commands, ideally in different terminal windows so you can watch them at the same time.

$ ruby examples/server
$ ruby examples/monitor
$ ruby examples/client

Installation

You need to install the gem using the following command:

$ gem install udipity

The server and the monitor require a Redis server to be running on localhost on port 6379.

Usage

require 'udipity'

host = '0.0.0.0' # UDP connections require an IP address
port = 9000

class Udipity::Command::Foo < Udipity::Command
  # Add code
end

Udipity::Server.register Udipity::Command::Foo
Udipity::Server.start host, port

Development

After checking out the repo, run bin/setup to install dependencies. Then, run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release to create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

  1. Fork it ( https://github.com/[my-github-username]/udipity/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request