From cf8f41c1ef77d43645eb6082ba76d4177ea6fbd4 Mon Sep 17 00:00:00 2001 From: sotech117 Date: Mon, 25 Sep 2023 23:01:27 -0400 Subject: first iteration README --- README | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/README b/README index 4d94406..4c48c7f 100644 --- a/README +++ b/README @@ -1 +1,32 @@ -todo \ No newline at end of file +# Project Title +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 make file uses. +* Run `make` in your terminal to make the 3 executables `./snowcast_server`, `./snowcast_control`, & `./snowcast_listener`! + +### Executing program + +* To run the server, type in `./snowcast_server` into your terminal. It wil tell you the necessary arguments. +* To run the controller, type `./snowcast_control` into your terminal. +* To run the listener, type `./snowcast_listener` into your terminal. + +### Program 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). During the downtime 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 the 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(...)`). + + +## Acknowledgments + +* [Beej's Guide to Network Programming](https://beej.us/guide/bgnet/) +* [Lecture Example Code](https://github.com/brown-csci1680/lecture-examples/tree/main) + -- cgit v1.2.3-70-g09d2 From 28679eed6e7f8f2e410b7a04ad1f02c4b516a756 Mon Sep 17 00:00:00 2001 From: sotech117 Date: Mon, 25 Sep 2023 23:02:09 -0400 Subject: Update and rename README to README.md --- README | 32 -------------------------------- README.md | 31 +++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 32 deletions(-) delete mode 100644 README create mode 100644 README.md diff --git a/README b/README deleted file mode 100644 index 4c48c7f..0000000 --- a/README +++ /dev/null @@ -1,32 +0,0 @@ -# Project Title -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 make file uses. -* Run `make` in your terminal to make the 3 executables `./snowcast_server`, `./snowcast_control`, & `./snowcast_listener`! - -### Executing program - -* To run the server, type in `./snowcast_server` into your terminal. It wil tell you the necessary arguments. -* To run the controller, type `./snowcast_control` into your terminal. -* To run the listener, type `./snowcast_listener` into your terminal. - -### Program 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). During the downtime 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 the 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(...)`). - - -## 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/README.md b/README.md new file mode 100644 index 0000000..38d8bd1 --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +# Project Title +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 make file uses. +* Run `make` in your terminal to make the 3 executables `./snowcast_server`, `./snowcast_control`, & `./snowcast_listener`! + +### Executing program + +* To run the server, type in `./snowcast_server` into your terminal. It wil tell you the necessary arguments. +* To run the controller, type `./snowcast_control` into your terminal. +* To run the listener, type `./snowcast_listener` into your terminal. + +### Program 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). During the downtime 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 the 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(...)`). + +## Acknowledgments + +* [Beej's Guide to Network Programming](https://beej.us/guide/bgnet/) +* [Lecture Example Code](https://github.com/brown-csci1680/lecture-examples/tree/main) + -- cgit v1.2.3-70-g09d2 From 188a810cf2a4aef190d40ab166332b13ef3a165e Mon Sep 17 00:00:00 2001 From: sotech117 Date: Mon, 25 Sep 2023 23:06:18 -0400 Subject: Update README.md --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 38d8bd1..2c842e6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -# Project Title -Snowcast +# Snowcast ## Description @@ -9,20 +8,25 @@ A music streaming server consisting of three programs: the server, the client co ### Making the executables -* Ensure you have gcc installed, as that is what the make file uses. +* 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 -* To run the server, type in `./snowcast_server` into your terminal. It wil tell you the necessary arguments. +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). During the downtime 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 the 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 -- cgit v1.2.3-70-g09d2 From 99488133dad8e8b6311c6719b8ee7688b0f1b7a6 Mon Sep 17 00:00:00 2001 From: sotech117 Date: Mon, 25 Sep 2023 23:07:20 -0400 Subject: Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2c842e6..d6b7c33 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Running the 3 executables without arguments will tell you the necessary argument 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). During the downtime 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 the second, the station thread then bradcasts a `cond` variable to start all threads that send the station. +* 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 :) -- cgit v1.2.3-70-g09d2