0.0
No commit activity in last 3 years
No release in over 3 years
Routes messages across a local network.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

LocalMessage Build Status

A Ruby Gem for sending messages as strings across a local network. (UDP style no handshake or acknowledgements)

This was spawned after encountering limitations during a group project at Dev Bootcamp. We had to write a Connect Four clone and play over Twitter. With multiple groups hammering the Twitter API simultaneously we were eventually cut off from the API altogether. Not a single Connect Four game was completed =(.

Todo

  • Markup with Rdoc
  • Add messaging list functionality to send messages to multiple users
  • Add a command to list all registered usernames & messaging lists
  • Add exception handling to the router
  • Add ability to turn console logging on or off for router

Usage

LocalMessageRouter => Maps usernames to ip addresses and a randomly generated port in order to route multiple simultaneous messages across a local network.

router = LocalMessageRouter.new(5000)

Start the router on port 5000

router.start

LocalMessageClient => Interacts with the LocalMessageRouter. Takes the server hostname/ip, listening port, and client username as arguments.

client = LocalMessageClient.new('localhost', 5000, 'sandbochs')

Registers username with the LocalMessageRouter.

client.register

Send a message, 'hello world' to the user, foobar. foobar's client.listen will return '@sandbochs hello world'

client.send_message("@foobar hello world")

Wait for a message from the server, returns a string

client.listen