2017-04-02 04:57:40 +00:00
# Hermes
2017-03-28 20:18:43 +00:00
2017-05-01 19:34:09 +00:00
![example ](https://github.com/oplS17projects/Hermes/blob/master/ext/Test_Figure.png )
2017-04-24 14:13:53 +00:00
2017-03-28 20:18:43 +00:00
### Statement
2017-04-02 04:50:49 +00:00
Hermes is a multi-client chat program akin to IRC written in Racket. Building
2017-04-22 23:50:14 +00:00
Hermes was interesting as it exposed us to various design problems namely networking,
synchronization, scheduling, GUI design, and component design.
2017-03-28 20:18:43 +00:00
### Analysis
2017-04-02 22:38:48 +00:00
> Will you use data abstraction? How?
2017-04-02 22:44:01 +00:00
2017-04-22 23:50:14 +00:00
TCP communication has been abstracted away, so that we deal with Hermes
2017-04-02 22:38:48 +00:00
definition of a message.
> Will you use recursion? How?
2017-04-02 22:44:01 +00:00
2017-04-23 21:48:05 +00:00
The server continually loops waiting for connections from clients. The clients
are always on standby to receive input.
2017-04-22 23:50:14 +00:00
The GUI continually loops to handle input from the user,
as well as to keep the canvas it writes the messages on updated.
2017-04-02 22:38:48 +00:00
2017-04-02 22:44:01 +00:00
> Will you use map/filter/reduce? How?
2017-04-23 21:48:05 +00:00
Map was used for dealing with input area of clients, and iterating over a list
of open ports to send messages. Filter was used to find the recipient of
a whisper.
2017-04-02 22:38:48 +00:00
> Will you use object-orientation? How?
2017-04-02 22:44:01 +00:00
2017-04-22 23:50:14 +00:00
Keeping count of the number of clients required working with objects that are able to
2017-04-23 21:48:05 +00:00
increment and decrement the number of users. We handled a list of connection
ports, messages similarly.
2017-04-22 23:50:14 +00:00
We also keep the GUI in an object so the many moving parts of the
user interface are packaged in one place.
2017-04-02 22:38:48 +00:00
> Will you use functional approaches to processing your data? How?
2017-04-02 22:44:01 +00:00
2017-04-02 22:38:48 +00:00
The communication part of Hermes is over tcp which uses a lot of functional
2017-04-03 03:56:27 +00:00
approaches e.g. you start a listener which you can call tcp-accept on.
2017-04-02 22:38:48 +00:00
The result of tcp accept are two pairs of ports which we can then bind to some
2017-04-23 21:48:05 +00:00
variables. Functional approaches are exemplied in most of the code base.
2017-04-02 22:38:48 +00:00
> Will you use state-modification approaches? How? (If so, this should be encapsulated within objects. `set!` pretty much should only exist inside an object.)
2017-04-02 22:44:01 +00:00
2017-04-23 21:48:05 +00:00
State-modification was used e.g. keeping count of logged in users requires
state modification via set! to maintain the true user account, managing the list
of open connections and messages required state-modification.
2017-04-22 23:50:14 +00:00
The user interface also needs a few states that it needs to keep up to date.
2017-04-02 22:38:48 +00:00
> Will you build an expression evaluator, like we did in the symbolic differentatior and the metacircular evaluator?
2017-04-02 22:44:01 +00:00
2017-04-23 21:48:05 +00:00
We allowed the use of a few commands through the user interface. The most notable ones
are the /whisper to send private messages to a user, /list count and /list users
to view user statistics , and the /color command to allow
2017-04-22 23:50:14 +00:00
the user to change the color of their text.
2017-03-28 20:18:43 +00:00
### Deliverable and Demonstration
2017-04-03 00:55:26 +00:00
There are two big deliverables for this project. Code for the server
, and the clients which not only has code for interacting with Hermes,
but also a GUI for interactivity with a user.
2017-04-02 04:50:49 +00:00
2017-04-23 21:48:05 +00:00
We are going to demonstrate Hermes by running the server code on a remote machine.
2017-04-02 04:50:49 +00:00
We will connect to the server via our PCs running client code. We will ssh into
the remote machine to see the server running. Since Hermes is a multichat anyone
can join in the demonstration by connecting their computers to the remote
machine!
2017-03-28 20:18:43 +00:00
2017-04-02 04:50:49 +00:00
2017-03-28 20:18:43 +00:00
### Evaluation of Results
2017-04-23 21:48:05 +00:00
Evaluating Hermes was very simple. Can at least two clients hold a meaningful
2017-04-02 14:58:55 +00:00
conversation remotely? If Client A speaks at 11:01 am, and client B does so at
2017-04-03 00:55:26 +00:00
11:01 plus a few seconds, Hermes has to convey this state correctly. Is the GUI
2017-04-23 21:48:05 +00:00
intuitive for current irc users? We successfully met these questions, and more.
2017-04-02 04:50:49 +00:00
2017-03-28 20:18:43 +00:00
## Architecture Diagram
2017-04-23 22:03:34 +00:00
#### Completed design
2017-04-10 02:37:50 +00:00
![Architecture ](https://github.com/oplS17projects/Hermes/blob/master/ext/arch_diagram.png )
2017-04-03 03:42:30 +00:00
2017-04-03 03:47:46 +00:00
2017-03-28 20:18:43 +00:00
## Schedule
2017-04-22 23:50:14 +00:00
The first step in our project was to setup a system to get data from one machine to another. What data exactly wasn't directly important and the other machine didn't really need to display it in a pretty manner, it just needed to relay that it has recieved the correct information.
2017-03-28 20:18:43 +00:00
2017-04-22 23:50:14 +00:00
Next we needed to create a user interface that looked nice. Some way to control the connection and display information in a convient and readable format.
2017-03-28 20:18:43 +00:00
2017-04-22 23:50:14 +00:00
After we finished the user interface and connecting the machines, we needed to merge them together and begin expanding the utility if time permits.
2017-03-28 20:18:43 +00:00
### First Milestone (Sun Apr 9)
2017-04-03 00:55:26 +00:00
Get two different machines to relay information meaningfully.
2017-03-28 20:18:43 +00:00
### Second Milestone (Sun Apr 16)
2017-04-03 00:55:26 +00:00
Get a GUI that looks professional and uses the correct format.
2017-03-28 20:18:43 +00:00
2017-04-22 23:50:14 +00:00
### Public Presentation (Mon Apr 24)
2017-04-02 15:40:19 +00:00
Merging the GUI and information relay together into one program. If time permits we also plan on adding additional features.
2017-03-28 20:18:43 +00:00
## Group Responsibilities
2017-04-02 04:57:40 +00:00
### Douglas Richardson @Doug-Richardson
2017-04-22 23:50:14 +00:00
I have written the code for the GUI.
It presents the user with a simple readable format for displaying the information
that the server provides. For the most part the program only interacts with the user
through the GUI.
2017-03-28 20:18:43 +00:00
2017-04-02 04:57:40 +00:00
### Ibrahim Mkusa @iskm
2017-04-23 22:06:09 +00:00
I wrote the networking code i.e. code that allows communication between
2017-04-23 21:48:05 +00:00
clients through server. I wrote scheduling code responsible for queueing
fairly the client messages and broadcasting to the rest of connected
2017-04-23 22:18:56 +00:00
clients. I also implemented the logic for handling /list, /whisper commands,
dialogs for gui code and related utilities.