aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsotech117 <michael_foiani@brown.edu>2023-09-25 23:09:10 -0400
committersotech117 <michael_foiani@brown.edu>2023-09-25 23:09:10 -0400
commit43290f717e22d50b99e49aebfd7fd4451d86d296 (patch)
tree388140c139fd2fd46d760f2b2c0e769e5ff7bbf1
parent6a2c567b85be275bb431c09952a88ea4cdf210aa (diff)
parent99488133dad8e8b6311c6719b8ee7688b0f1b7a6 (diff)
pull readme
-rw-r--r--README1
-rw-r--r--README.md35
-rwxr-xr-xsnowcast_controlbin35133 -> 18808 bytes
-rwxr-xr-xsnowcast_listenerbin34542 -> 13928 bytes
-rwxr-xr-xsnowcast_serverbin71756 -> 37752 bytes
5 files changed, 35 insertions, 1 deletions
diff --git a/README b/README
deleted file mode 100644
index 4d94406..0000000
--- a/README
+++ /dev/null
@@ -1 +0,0 @@
-todo \ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..d6b7c33
--- /dev/null
+++ b/README.md
@@ -0,0 +1,35 @@
+# Snowcast
+
+## Description
+
+A music streaming server consisting of three programs: the server, the client controller, & the client listener.
+
+## Getting Started
+
+### Making the executables
+
+* Ensure you have gcc installed, as that is what the Makefile uses.
+* Run `make` in your terminal to make the 3 executables `./snowcast_server`, `./snowcast_control`, & `./snowcast_listener`!
+
+### Executing program
+
+Running the 3 executables without arguments will tell you the necessary arguments to get going.
+
+* To run the server, type in `./snowcast_server` into your terminal.
+* To run the controller, type `./snowcast_control` into your terminal.
+* To run the listener, type `./snowcast_listener` into your terminal.
+
+### Program Design
+
+I did not implement origonal design doc, due to random malloc errors with the autograder. I rewrote the server, with the the design...
+
+* A "select_thread" controls accepting new clients and responding to commands from clients. It redirects the logic to separate helper functions to send replies.
+* The station information is held by an array. Each station has a thread that broadcasts to the listeners every half-second (at half the rate per second). At the bottom of this half-second, the station file is read into a buffer and threads are created off of this buffer, waiting to be released. At the top of this half-second, the station thread then bradcasts a `cond` variable to start all threads that send the station.
+* The `users` pointer containing the user data (along with the separate stations pointer) has a mutex `users_mutex` that allows safe-thread write and deletion. This pointer is also dynamic, using realloc when more memory is needed. There are a few memory optimizations implemented (see `init_user(...)`).
+* The code is well documented, so many smaller design choices can be read there :)
+
+## Acknowledgments
+
+* [Beej's Guide to Network Programming](https://beej.us/guide/bgnet/)
+* [Lecture Example Code](https://github.com/brown-csci1680/lecture-examples/tree/main)
+
diff --git a/snowcast_control b/snowcast_control
index 4b59e54..732138e 100755
--- a/snowcast_control
+++ b/snowcast_control
Binary files differ
diff --git a/snowcast_listener b/snowcast_listener
index 455fcdc..ed4386e 100755
--- a/snowcast_listener
+++ b/snowcast_listener
Binary files differ
diff --git a/snowcast_server b/snowcast_server
index 9733366..5ce7fb6 100755
--- a/snowcast_server
+++ b/snowcast_server
Binary files differ