Homework 3 – Bulletin Board System: Part 3 solved

$40.00

Category: You will receive a download link of the .ZIP file upon Payment

Description

Rate this product

Intro. to Network Programming
Description
In this part, you are going to write a client program for BBS service. However, in this part, the content of the
post will store on the client-side (Amazon S3) instead of the server-side. Take the post function of the BBS service,
for example. The server in this part only stores the metadata of posts (e.g., post id, post title, author and date.)
except for the content of the post. That is to say, each client has its storage to store the content of their posts,
and we use Amazon S3 for the storage service. Besides, you are also going to implement new features such as a
simple mail service.
System Architecture
The server here only stores user information, boards and some metadata of posts. (e.g., post id, post title,
etc). The real content of the post will store on the client-side (Amazon S3). Each bucket of Amazon S3
represents the storage of each client. So, each client can store the content of its posts in its bucket, and this
bucket is also an incoming mailbox for the mail service of this client. Note that only your client program can
get access to Amazon S3 using Amazon S3 API.
Requirements
The service can serve at least 10 clients. Your server and client program must be able to handle all commands
in the previous part (output results must be the same as the previous part). For some commands such as
whoami, exit, logout, create-board, list-board ## and list-post ##, your client
program only sends the command to the server and gets the corresponding result from the server. However, there
are some commands that your client program will interact with Amazon S3. These commands are described as
follows:
Command format Description Result
register If successful execution, your client
program will create a new bucket in
Amazon S3 for this new user, and your
server program will store the bucket
name of this new user so that the user
will be able to log in with its bucket in the
future.
If failed, only print the error message.
Success Register successfully.
Fail Username is already used.
login If successful execution, the user will log
in with its Amazon S3 bucket, so that it
can manipulate (e.g., upload posts,
delete posts, etc) its bucket in the future.
If failed, only print the error message.
Success Welcome, .
Fail (1) Please logout first.
Fail (2) Login failed.
create-post –title —<br /> content <content><br /> (command is in the same line )<br /> If successful execution, the user (client)<br /> will upload the content of this post to<br /> its S3 bucket using Amazon S3 API,<br /> and the server will keep the metadata of<br /> this post.<br /> If failed, only print the error message.<br /> Success Create post successfully.<br /> Fail (1) Board does not exist.<br /> Fail (2) Please login first.<br /> read <post-id> Show the post whose ID is <post-id>.<br /> If successful execution, the client will<br /> get the content of this post from the<br /> post owner’s bucket using Amazon S3<br /> API and print the result.<br /> If failed, only print the error message.<br /> Success Author :<Author1><br /> Title :<Title1><br /> Date :<Date1><br /> —<br /> <content><br /> —<br /> <User1>:<Comment1><br /> Fail Post does not exist.<br /> delete-post <post-id> Delete the post whose ID is <post-id>.<br /> If successful execution, the user (client)<br /> will delete this post from its bucket,<br /> and the server will delete the metadata<br /> of this post.<br /> If failed, only print the error message.<br /> Success Delete successfully.<br /> Fail (1) Please login first.<br /> Fail (2) Post does not exist.<br /> Fail (3) Not the post owner.<br /> update-post <post-id> –title/content <new> Update the post whose ID is <post-id>.<br /> If a successful update on the title, the<br /> server will update the title of this post.<br /> If a successful update on the content, the<br /> user (client) will update the content of<br /> this post in Amazon S3 using Amazon<br /> S3 API.<br /> If failed, only print the error message.<br /> Success Update successfully.<br /> Fail (1) Please login first.<br /> Fail (2) Post does not exist.<br /> Fail (3) Not the post owner.<br /> comment <post-id> <comment> Add a comment < comment > to the post<br /> whose ID is <post-id>.<br /> If successful execution, the user (client)<br /> will append the comment to the content<br /> of this post in the post owner’s bucket.<br /> That is to say, the comment stores in the<br /> post owner’s bucket.<br /> If failed, only print the error message.<br /> Success Comment successfully.<br /> Fail (1) Please login first.<br /> Fail (2) Post does not exist.<br /> Also, there are some new commands you have to implement for simple mail service. These commands are<br /> described as follows:<br /> Command format Description Result<br /> mail-to <username> –subject <subject><br /> –content <content><br /> (command is in the same line )<br /> Send a mail whose subject is <subject><br /> and content is <content> to user<br /> <username>.<br /> Use –subject and –content to separate<br /> subject and content.<br /> <subject> has the same format as <title><br /> of the post.<br /> <content> has the same format as<br /> <content> of the post.<br /> If successful execution, the user (client)<br /> will create an object with <content> in<br /> user <username>’s bucket using<br /> Amazon S3 API.<br /> Failed execution:<br /> Fail (1): No user logged in.<br /> Fail (2): User <username> doesn’t exist.<br /> Success Sent successfully.<br /> Fail (1) Please login first.<br /> Fail (2) <username> does not exist.<br /> list-mail List all incoming mails of the current<br /> logged in user.<br /> Success:<br /> Note that each user has its mail id<br /> sequence numbers. It should start at<br /> 1.<br /> Success ID Subject From Date<br /> 1 <Subject1><From_user1> <Date1><br /> 2 <Subject2><From_user2> <Date2><br /> Fail (1) Please login first.<br /> <Subject1> represents the subject of this<br /> mail.<br /> <From_user1> represents that this mail<br /> is sent by user <From_user1>.<br /> <Date1> represents the sent date of this<br /> mail.<br /> There is a \t between each column.<br /> Failed execution:<br /> Fail (1): No user logged in.<br /> retr-mail <mail#> Retrieve the content of the mail <mail#><br /> If successful execution, the user (client)<br /> will get the content of the mail from its<br /> bucket using Amazon S3 API and print<br /> the result.<br /> <Subject1> represents the subject of this<br /> mail.<br /> <From_user1> represents that this mail<br /> is sent by user <From_user1>.<br /> <Date1> represents the sent date of this<br /> mail.<br /> There is a \t before ‘:’.<br /> Failed execution:<br /> Fail (1): No user logged in.<br /> Fail (2): Mail <mail#> is not in your<br /> mailbox.<br /> Success Subject :<Subject1><br /> From :<From_user1><br /> Date :<Date1><br /> —<br /> <content><br /> Fail (1) Please login first.<br /> Fail (2) No such mail.<br /> delete-mail <mail#> Delete mail <mail#> from your mailbox.<br /> If successful execution, the user (client)<br /> will delete the content of the mail from<br /> its bucket using Amazon S3 API.<br /> Failed execution:<br /> Fail (1): No user logged in.<br /> Fail (2): Mail <mail#> is not in your<br /> mailbox.<br /> Success Mail deleted.<br /> Fail (1) Please login first.<br /> Fail (2) No such mail.<br /> Scenario<br /> Run your server first, and run your client program to connect to your server. If the line only shows “% “, that means<br /> we type <Enter> in our client program. It is just for the height alignment of two columns here. You can ignore that.<br /> The sample outputs of the client program are listed as follows:<br /> Terminal output Description and Amazon S3 Console State<br /> Start with nothing in your Amazon S3.<br /> bash$ ./client 127.0.0.1 7890<br /> ********************************<br /> ** Welcome to the BBS server. **<br /> ********************************<br /> % register Brad bb@cs.nctu.edu.tw 12345<br /> Register successfully.<br /> %<br /> Create a bucket for user Brad. You can name the bucket name<br /> of each user by yourself, but there are some limitations of the<br /> bucket name. Please refer to the Note part.<br /> % register Brad bb@cs.nctu.edu.tw 12345<br /> Username is already used.<br /> Just print the error message. Nothing changes in Amazon S3.<br /> % register V v@cs.nctu.edu.tw bt21<br /> Register successfully.<br /> %<br /> %<br /> %<br /> %<br /> Create a bucket for user V.<br /> % login Brad 12345<br /> Welcome, Brad.<br /> The client program will log in with Brad’s bucket.<br /> % whoami<br /> Brad<br /> Nothing changes in Amazon S3.<br /> % create-board NP_HW<br /> Create board successfully.<br /> Nothing changes in Amazon S3.<br /> % create-board NP_HW<br /> Board already exist.<br /> Nothing changes in Amazon S3.<br /> % list-board<br /> Index Name Moderator<br /> 1 NP_HW Brad<br /> %<br /> %<br /> Nothing changes in Amazon S3.<br /> % list-board ##HW<br /> Index Name Moderator<br /> 1 NP_HW Brad<br /> Nothing changes in Amazon S3.<br /> % create-post NP_HW –title NP_HW3 –content Err…<br />Ha!<br /> Create post successfully.<br /> %<br /> %<br /> %<br /> %<br /> %<br /> %<br /> %<br /> %<br /> %<br /> Create an object to store the content of this post in Brad’s<br /> bucket. By the way, you can name the object by yourself, but<br /> there are some restrictions for object naming. Please refer to<br /> the Note part.<br /> % create-post NCTU –title NP_HW3 –content Uh…<br /> Board does not exist.<br /> Nothing changes in Amazon S3.<br /> % create-post NP_HW –title NP_HW4 –content Wow…<br /> Create post successfully.<br /> %<br /> %<br /> %<br /> %<br /> %<br /> %<br /> %<br /> %<br /> Create a new post.<br /> % list-post NP<br /> Board does not exist.<br /> %<br /> %<br /> Nothing changes in Amazon S3.<br /> % list-post NP_HW<br /> ID Title Author Date<br /> 1 NP_HW3 Brad 04/14<br /> 2 NP_HW4 Brad 04/14<br /> Nothing changes in Amazon S3.<br /> % list-post NP_HW ##HW3<br /> ID Title Author Date<br /> 1 NP_HW3 Brad 04/14<br /> Nothing changes in Amazon S3.<br /> % read 888<br /> Post does not exist.<br /> %<br /> %<br /> %<br /> Nothing changes in Amazon S3.<br /> % read 1<br /> Author :Brad<br /> Title :NP_HW3<br /> Date :2020-04-14<br /> —<br /> Err…<br /> Ha!<br /> —<br /> Get the content of post 1 from the post owner’s bucket.<br /> % update-post 888 –title NP HW_4<br /> Post does not exist.<br /> Nothing changes in Amazon S3.<br /> % update-post 1 –title NP HW_4<br /> Update successfully.<br /> %<br /> %<br /> %<br /> %<br /> %<br /> %<br /> %<br /> %<br /> %<br /> %<br /> The state of Amazon S3 may be unchanged. It depends on your<br /> design. But for my design, I changed the object key of that post.<br /> % read 1<br /> Author :Brad<br /> Title :NP HW_4<br /> Date :2020-04-14<br /> —<br /> Err…<br /> Ha!<br /> —<br /> Get the content of post 1 from the post owner’s bucket.<br /> % update-post 1 –content Yeah!<br /> Update successfully.<br /> Update the content of this post in Amazon S3.<br /> % read 1<br /> Author :Brad<br /> Title :NP HW_4<br /> Date :2020-04-14<br /> —<br /> Yeah!<br /> —<br /> Get the content of post 1 from the post owner’s bucket.<br /> % logout<br /> Bye, Brad.<br /> Nothing changes in Amazon S3.<br /> % whoami Nothing changes in Amazon S3.<br /> Please login first.<br /> % logout<br /> Please login first.<br /> Nothing changes in Amazon S3.<br /> % login V bt21<br /> Welcome, V.<br /> The client program will login with V’s bucket.<br /> % create-post NP_HW –title Hello –content I am</p> <p>V.<br /> Create post successfully.<br /> %<br /> %<br /> %<br /> %<br /> %<br /> %<br /> %<br /> % update-post 1 –content Ha!<br />ha!<br /> Not the post owner.<br /> Nothing changes in Amazon S3.<br /> % delete-post 1<br /> Not the post owner.<br /> Nothing changes in Amazon S3.<br /> % comment 888 Ha ha!<br /> Post does not exist.<br /> Nothing changes in Amazon S3.<br /> % comment 1 Ha ha!<br /> Comment successfully.<br /> %<br /> The client program will append the comment to the<br /> corresponding post object (e.g., NP_HW_4-<br /> 1586850747968524907 object in Brad’s bucket) in Amazon S3.<br /> % read 1<br /> Author :Brad<br /> Title :NP HW_4<br /> Date :2020-04-14<br /> —<br /> Yeah!<br /> —<br /> V:Ha ha!<br /> Get the content of post 1 from the post owner’s bucket.<br /> % mail-to TT –subject Hi TT –content Hi <br /> TT!<br /> TT does not exist.<br /> Nothing changes in Amazon S3.<br /> % mail-to Brad –subject Hi Brad –content Hi <br /> Brad!<br /> Sent successfully.<br /> % mail-to Brad –subject Hey –content Hey <br />Brad!<br /> Sent successfully.<br /> %<br /> %<br /> %<br /> %<br /> %<br /> User V creates two email objects in Brad’s bucket.<br /> % list-mail<br /> ID Subject From Date<br /> Nothing changes in Amazon S3.<br /> % delete-mail 1<br /> No such mail.<br /> Nothing changes in Amazon S3.<br /> % retr-mail 1<br /> No such mail.<br /> Nothing changes in Amazon S3.<br /> % logout<br /> Bye, V.<br /> Nothing changes in Amazon S3.<br /> % login Brad 12345<br /> Welcome, Brad.<br /> The client program will login with Brad’s bucket.<br /> % list-mail<br /> ID Subject From Date<br /> 1 Hi Brad V 04/14<br /> 2 Hey V 04/14<br /> Nothing changes in Amazon S3.<br /> % retr-mail 1<br /> Subject :Hi Brad<br /> From :V<br /> Date :2020-04-14<br /> —<br /> Hi<br /> Brad!<br /> Get the content of the mail from his bucket.<br /> % mail-to V –subject Hi V –content WoW V!<br /> Sent successfully.<br /> %<br /> %<br /> %<br /> %<br /> %<br /> %<br /> %<br /> User Brad creates a mail object in V’s bucket.<br /> % logout<br /> Bye, Brad.<br /> Nothing changes in Amazon S3.<br /> % login V bt21<br /> Welcome, V.<br /> The client program will login with V’s bucket.<br /> % list-mail<br /> ID Subject From Date<br /> 1 Hi V Brad 04/14<br /> Nothing changes in Amazon S3. But note that user V has its<br /> mail id sequence number. It starts at 1.<br /> % logout<br /> Bye, V.<br /> Nothing changes in Amazon S3.<br /> % login Brad 12345<br /> Welcome, Brad.<br /> The client program will login with Brad’s bucket.<br /> % list-mail<br /> ID Subject From Date<br /> 1 Hi Brad V 04/14<br /> 2 Hey V 04/14<br /> Nothing changes in Amazon S3.<br /> % delete-mail 1<br /> Mail deleted.<br /> %<br /> %<br /> %<br /> %<br /> %<br /> %<br /> %<br /> %<br /> %<br /> User Brad deletes the object corresponding to his mail 1 from<br /> his bucket.<br /> % list-mail<br /> ID Subject From Date<br /> 1 Hey V 04/14<br /> Nothing changes in Amazon S3. But note that ID of the mail with<br /> the subject “Hey” is 1.<br /> % logout<br /> Bye, Brad.<br /> Nothing changes in Amazon S3.<br /> % exit Nothing changes in Amazon S3.<br /> Note<br /> 1. About bucket naming:<br /> • Bucket names must be unique across all existing bucket names in Amazon S3.<br /> • Bucket names must be at least 3 and no more than 63 characters long.<br /> • Bucket names must not contain uppercase characters or underscores.<br /> • Bucket names must start with a lowercase letter or number.<br /> 2. About object key name:<br /> • Unique identifier within a bucket. If you upload the same key name object without versioning-enabled, it will<br /> overwrite the original one.<br /> • The following character sets are generally safe for use in key names.<br /> For more details about buckets and objects, you can refer to reference [5][6]<br /> 3. About AWS API access key:<br /> If you want to use AWS SDK to make Amazon S3 API calls, you have to provide your AWS credential first.<br /> How to set up authentication credential:<br /> Create a credential file at ~/.aws/credentials. The content of this file is described as follows:<br /> [default]<br /> aws_access_key_id=<your access key><br /> aws_secret_access_key=<your secret access key><br /> aws_session_token=<your session token><br /> You can get these key from your AWS Educate account. Log in your account and go to Intro. to Network<br /> Programming classroom. Then, you will see the following page.<br /> Click Account Details<br /> Click Show and copy those keys into ~/.aws/credentials<br /> The credential we use here is temporary, so you have to copy and paste again when the credential<br /> expiration.<br /> 4. About C++ AWS SDK:<br /> To use the AWS SDK for C++, you need:<br /> ⚫ Visual Studio 2015 or later<br /> ⚫ or GNU Compiler Collection (GCC) 4.9 or later<br /> ⚫ or Clang 3.3 or later<br /> ⚫ A minimum of 4 GB of RAM<br /> So, if you currently use Amazon EC2 with instance type of t2.micro, please change to at least t2.medium.<br /> Moreover, please backup all your environment when you are running out of classroom credits. We suggest<br /> you write a script to set up your environment. It will save a lot of time.<br /> How to change instance type:<br /> Right-click your original instance -> Instance Settings -> Change Instance Type<br /> 5. You can use any code examples in the Amazon S3 API documentation to manipulate your Amazon<br /> S3.<br /> Grade (100%)<br /> For those commands that interact with Amazon S3, we will check your Amazon S3 console. If the state of<br /> your Amazon S3 is wrong, we will deduct some scores of that command.<br /> ⚫ register command – (8%)<br /> ⚫ login command – (8%)<br /> ⚫ create-post command – (8%)<br /> ⚫ read command – (8%)<br /> ⚫ delete-post command – (8%)<br /> ⚫ update-post command – (8%)<br /> ⚫ comment command – (8%)<br /> ⚫ mail-to command – (8%)<br /> ⚫ list-mail command – (8%)<br /> ⚫ retr-mail command – (8%)<br /> ⚫ delete-mail command – (8%)<br /> ⚫ list-post command – (5%)<br /> ⚫ logout command – (2%)<br /> ⚫ exit command – (2%)<br /> ⚫ whoami command – (1%)<br /> ⚫ create-board command – (1%)<br /> ⚫ list-board command – (1%)<br /> Submission<br /> Please upload a zip file called “hw3_{$student_id}.zip” (e.g., hw3_0856020.zip) that includes your source code. It<br /> must include at least your server source code and client source code. Submission that doesn’t follow the rule<br /> will get 20% punishment on the grade.<br /> You will get 0 points on this project for plagiarism. Please don’t copy-paste other students’ code!<br /> Reference<br /> 1. C/C++ Socket<br /> 2. SQLite C/C++ Interface<br /> 3. Linux socket SELECT<br /> 4. AWS SDK supported languages<br /> 5. Bucket Restrictions and Limitations<br /> 6. Object Key and Metadata<br /> 7. AWS Command Line Interface<br /> 8. AWS SDK for C++<br /> 9. AWS SDK for Python<br /> 10. Sequence diagram reference</p> </div> </div> <section class="related products"> <h2>Related products</h2> <ul class="products columns-3"> <li class="product type-product post-12770 status-publish first instock product_cat-intro-to-network-programming has-post-thumbnail downloadable virtual purchasable product-type-simple"> <a href="https://codeshive.com/product/homework-4-bulletin-board-system-pub-sub-system-solved/" class="woocommerce-LoopProduct-link woocommerce-loop-product__link"><img width="225" height="225" src="https://codeshive.com/wp-content/uploads/2021/01/download-8.jpg" class="attachment-woocommerce_thumbnail size-woocommerce_thumbnail" alt="" decoding="async" srcset="https://codeshive.com/wp-content/uploads/2021/01/download-8.jpg 225w, https://codeshive.com/wp-content/uploads/2021/01/download-8-100x100.jpg 100w, https://codeshive.com/wp-content/uploads/2021/01/download-8-150x150.jpg 150w" sizes="(max-width: 225px) 100vw, 225px" /><h2 class="woocommerce-loop-product__title">Homework 4 – Bulletin Board System: Pub/Sub system solved</h2> <span class="price"><span class="woocommerce-Price-amount amount"><bdi><span class="woocommerce-Price-currencySymbol">$</span>40.00</bdi></span></span> </a><a href="?add-to-cart=12770" aria-describedby="woocommerce_loop_add_to_cart_link_describedby_12770" data-quantity="1" class="button product_type_simple add_to_cart_button ajax_add_to_cart" data-product_id="12770" data-product_sku="" aria-label="Add to cart: “Homework 4 - Bulletin Board System: Pub/Sub system solved”" rel="nofollow">View This Answer</a><span id="woocommerce_loop_add_to_cart_link_describedby_12770" class="screen-reader-text"> </span> </li> <li class="product type-product post-12763 status-publish instock product_cat-intro-to-network-programming has-post-thumbnail downloadable virtual purchasable product-type-simple"> <a href="https://codeshive.com/product/homework-1-bulletin-board-system-part-1-solved/" class="woocommerce-LoopProduct-link woocommerce-loop-product__link"><img width="225" height="225" src="https://codeshive.com/wp-content/uploads/2021/01/download-8.jpg" class="attachment-woocommerce_thumbnail size-woocommerce_thumbnail" alt="" decoding="async" srcset="https://codeshive.com/wp-content/uploads/2021/01/download-8.jpg 225w, https://codeshive.com/wp-content/uploads/2021/01/download-8-100x100.jpg 100w, https://codeshive.com/wp-content/uploads/2021/01/download-8-150x150.jpg 150w" sizes="(max-width: 225px) 100vw, 225px" /><h2 class="woocommerce-loop-product__title">Homework 1 – Bulletin Board System: Part 1 solved</h2> <span class="price"><span class="woocommerce-Price-amount amount"><bdi><span class="woocommerce-Price-currencySymbol">$</span>40.00</bdi></span></span> </a><a href="?add-to-cart=12763" aria-describedby="woocommerce_loop_add_to_cart_link_describedby_12763" data-quantity="1" class="button product_type_simple add_to_cart_button ajax_add_to_cart" data-product_id="12763" data-product_sku="" aria-label="Add to cart: “Homework 1 - Bulletin Board System: Part 1 solved”" rel="nofollow">View This Answer</a><span id="woocommerce_loop_add_to_cart_link_describedby_12763" class="screen-reader-text"> </span> </li> <li class="product type-product post-12765 status-publish last instock product_cat-intro-to-network-programming has-post-thumbnail downloadable virtual purchasable product-type-simple"> <a href="https://codeshive.com/product/homework-2-bulletin-board-system-part-2-solved/" class="woocommerce-LoopProduct-link woocommerce-loop-product__link"><img width="225" height="225" src="https://codeshive.com/wp-content/uploads/2021/01/download-8.jpg" class="attachment-woocommerce_thumbnail size-woocommerce_thumbnail" alt="" decoding="async" loading="lazy" srcset="https://codeshive.com/wp-content/uploads/2021/01/download-8.jpg 225w, https://codeshive.com/wp-content/uploads/2021/01/download-8-100x100.jpg 100w, https://codeshive.com/wp-content/uploads/2021/01/download-8-150x150.jpg 150w" sizes="(max-width: 225px) 100vw, 225px" /><h2 class="woocommerce-loop-product__title">Homework 2 – Bulletin Board System: Part 2 solved</h2> <span class="price"><span class="woocommerce-Price-amount amount"><bdi><span class="woocommerce-Price-currencySymbol">$</span>40.00</bdi></span></span> </a><a href="?add-to-cart=12765" aria-describedby="woocommerce_loop_add_to_cart_link_describedby_12765" data-quantity="1" class="button product_type_simple add_to_cart_button ajax_add_to_cart" data-product_id="12765" data-product_sku="" aria-label="Add to cart: “Homework 2 - Bulletin Board System: Part 2 solved”" rel="nofollow">View This Answer</a><span id="woocommerce_loop_add_to_cart_link_describedby_12765" class="screen-reader-text"> </span> </li> </ul> </section> <nav class="storefront-product-pagination" aria-label="More products"> <a href="https://codeshive.com/product/homework-2-bulletin-board-system-part-2-solved/" rel="prev"> <img width="225" height="225" src="https://codeshive.com/wp-content/uploads/2021/01/download-8.jpg" class="attachment-woocommerce_thumbnail size-woocommerce_thumbnail" alt="" loading="lazy" /> <span class="storefront-product-pagination__title">Homework 2 - Bulletin Board System: Part 2 solved</span> </a> <a href="https://codeshive.com/product/homework-4-bulletin-board-system-pub-sub-system-solved/" rel="next"> <img width="225" height="225" src="https://codeshive.com/wp-content/uploads/2021/01/download-8.jpg" class="attachment-woocommerce_thumbnail size-woocommerce_thumbnail" alt="" loading="lazy" /> <span class="storefront-product-pagination__title">Homework 4 - Bulletin Board System: Pub/Sub system solved</span> </a> </nav><!-- .storefront-product-pagination --> </div> </main><!-- #main --> </div><!-- #primary --> <div id="secondary" class="widget-area" role="complementary"> <div id="block-32" class="widget widget_block widget_text"><p class="has-luminous-vivid-orange-color has-text-color"><strong>POPULAR SERVICES</strong></p></div><div id="block-33" class="widget widget_block widget_text"><p class="has-vivid-purple-color has-text-color"><a href="https://codeshive.com/order-now/">C programming assignment help</a><br><a href="https://codeshive.com/order-now/">Computer networking assignment help</a><br><a href="https://codeshive.com/order-now/">Computer science homework help</a><br><a href="https://codeshive.com/order-now/">Database management homework help</a><br><a href="https://codeshive.com/order-now/">Java programming help</a><br><a href="https://codeshive.com/order-now/">Matlab assignment help</a><br><a href="https://codeshive.com/order-now/">Php assignment help</a><br><a href="https://codeshive.com/order-now/">Python programming assignment help</a><br><a href="https://codeshive.com/order-now/">SQL assignment help</a><br><a href="https://codeshive.com/order-now/">Html homework help</a></p></div><div id="block-34" class="widget widget_block widget_text"><p>The Codes Hive believes in helping students to write clean codes that are simple to read and easy to execute.Based in New York, United States, we provide assignment help, homework help, online tutoring and project help in programming to the students and professionals across the globe.</p></div><div id="block-21" class="widget widget_block widget_text"><p>Disclaimer<strong>:</strong> The reference papers/tutorials provided are to be considered as model papers only and are not to submitted as it is. These papers are intended to be used for research and reference purposes only.</p></div><div id="search-2" class="widget widget_search"><form role="search" method="get" class="search-form" action="https://codeshive.com/"> <label> <span class="screen-reader-text">Search for:</span> <input type="search" class="search-field" placeholder="Search …" value="" name="s" /> </label> <input type="submit" class="search-submit" value="Search" /> </form></div><div id="text-3" class="widget widget_text"><span class="gamma widget-title">Why You Should Hire Codeshive Tutors</span> <div class="textwidget"><ul> <li><span class="grade"><img decoding="async" title="" src="https://homeworkdoer.org/images/icon-grade.gif" alt="" /></span>Guaranteed A or B Grade</li> <li><span class="money-back"><img decoding="async" title="" src="https://homeworkdoer.org/images/icon-money-back.gif" alt="" /></span>Money back guarantee</li> <li><span class="save-time"><img decoding="async" title="" src="https://homeworkdoer.org/images/icon-save-time.gif" alt="" /></span>Save Time</li> <li><span class="moreless-time"><img decoding="async" title="" src="https://homeworkdoer.org/images/icon-moreless-time.gif" alt="" /></span>Achieve more in less time</li> <li><span class="support"><img decoding="async" title="" src="https://homeworkdoer.org/images/icon-support2.gif" alt="" /></span>24/7 Customer support</li> </ul> </div> </div></div><!-- #secondary --> </div><!-- .col-full --> </div><!-- #content --> <footer id="colophon" class="site-footer" role="contentinfo"> <div class="col-full"> <div class="footer-widgets row-1 col-3 fix"> <div class="block footer-widget-1"> <div id="block-29" class="widget widget_block"><div itemprop="location" itemscope itemtype="http://schema.org/Organization" class="wp-block-jetpack-contact-info"><div class="wp-block-jetpack-email">Email <a itemprop="email" href="mailto:codeshive21@gmail.com">codeshive21@gmail.com</a></div> <div class="wp-block-jetpack-phone"><span class="phone-prefix">Tel </span><span itemprop="telephone"><a href="tel:+15414237793">+1 541-423-7793</a></span></div> <div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress" class="wp-block-jetpack-address" ><div itemprop="streetAddress" class="jetpack-address__address jetpack-address__address1">New York</div><div itemprop="addressCountry" class="jetpack-address__country">United States</div></div></div></div> </div> <div class="block footer-widget-2"> <div id="block-23" class="widget widget_block widget_media_image"><figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="521" height="96" src="https://codeshive.com/wp-content/uploads/2021/08/images-1.jpg" alt="" class="wp-image-15965" srcset="https://codeshive.com/wp-content/uploads/2021/08/images-1.jpg 521w, https://codeshive.com/wp-content/uploads/2021/08/images-1-300x55.jpg 300w, https://codeshive.com/wp-content/uploads/2021/08/images-1-416x77.jpg 416w" sizes="(max-width: 521px) 100vw, 521px" /><figcaption>All Payments are secured</figcaption></figure></div> </div> <div class="block footer-widget-3"> <div id="block-43" class="widget widget_block"><div class="wp-block-ub-social-share" id="ub-social-share-8bccb7ab-4558-4dcf-884b-612bb67c5392"> <div class="social-share-icons align-icons-left orientation-icons-row"><a aria-label="facebook-logo" target="_blank" rel="nofollow" href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fcodeshive.com%2Fproduct%2Fhomework-3-bulletin-board-system-part-3-solved%2F&title=Homework%203%20%26%238211%3B%20Bulletin%20Board%20System%3A%20Part%203%20solved" class="ub-social-share-facebook-container"> <span class="social-share-icon ub-social-share-facebook"><svg xmlns="http://www.w3.org/2000/svg" style="fill:#1877f2" fill="#1877f2" width="20" height="20" viewBox="0 0 264 512"><path d="M76.7 512V283H0v-91h76.7v-71.7C76.7 42.4 124.3 0 193.8 0c33.3 0 61.9 2.5 70.2 3.6V85h-48.2c-37.8 0-45.1 18-45.1 44.3V192H256l-11.7 91h-73.6v229" /></svg></span><span>share</span></a><a aria-label="twitter-logo" target="_blank" rel="nofollow" href="http://twitter.com/intent/tweet?url=https%3A%2F%2Fcodeshive.com%2Fproduct%2Fhomework-3-bulletin-board-system-part-3-solved%2F&text=Homework%203%20%26%238211%3B%20Bulletin%20Board%20System%3A%20Part%203%20solved" class="ub-social-share-twitter-container"> <span class="social-share-icon ub-social-share-twitter"><svg xmlns="http://www.w3.org/2000/svg" style="color:#1d9BF0" fill="#1d9BF0" width="20" height="20" viewBox="0 0 24 24"><path d="M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584l-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z" /></svg></span><span>tweet</span></a><a aria-label="linkedin-logo" target="_blank" rel="nofollow" href="https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcodeshive.com%2Fproduct%2Fhomework-3-bulletin-board-system-part-3-solved%2F" class="ub-social-share-linkedin-container"> <span class="social-share-icon ub-social-share-linkedin"><svg xmlns="http://www.w3.org/2000/svg" style="fill:#2867b2" fill="#2867b2" width="20" height="20" viewBox="0 0 448 512"><path d="M100.3 480H7.4V180.9h92.9V480zM53.8 140.1C24.1 140.1 0 115.5 0 85.8 0 56.1 24.1 32 53.8 32c29.7 0 53.8 24.1 53.8 53.8 0 29.7-24.1 54.3-53.8 54.3zM448 480h-92.7V334.4c0-34.7-.7-79.2-48.3-79.2-48.3 0-55.7 37.7-55.7 76.7V480h-92.8V180.9h89.1v40.8h1.3c12.4-23.5 42.7-48.3 87.9-48.3 94 0 111.3 61.9 111.3 142.3V480z" /></svg></span><span>share</span></a><a aria-label="pinterest-logo" target="_blank" rel="nofollow" href="https://pinterest.com/pin/create/button/?&url=https%3A%2F%2Fcodeshive.com%2Fproduct%2Fhomework-3-bulletin-board-system-part-3-solved%2F&description=Homework%203%20%26%238211%3B%20Bulletin%20Board%20System%3A%20Part%203%20solved&media=https://codeshive.com/wp-content/uploads/2021/01/download-8.jpg" class="ub-social-share-pinterest-container"> <span class="social-share-icon ub-social-share-pinterest"><svg xmlns="http://www.w3.org/2000/svg" style="fill:#e60023" fill="#e60023" width="20" height="20" viewBox="0 0 384 512"><path d="M204 6.5C101.4 6.5 0 74.9 0 185.6 0 256 39.6 296 63.6 296c9.9 0 15.6-27.6 15.6-35.4 0-9.3-23.7-29.1-23.7-67.8 0-80.4 61.2-137.4 140.4-137.4 68.1 0 118.5 38.7 118.5 109.8 0 53.1-21.3 152.7-90.3 152.7-24.9 0-46.2-18-46.2-43.8 0-37.8 26.4-74.4 26.4-113.4 0-66.2-93.9-54.2-93.9 25.8 0 16.8 2.1 35.4 9.6 50.7-13.8 59.4-42 147.9-42 209.1 0 18.9 2.7 37.5 4.5 56.4 3.4 3.8 1.7 3.4 6.9 1.5 50.4-69 48.6-82.5 71.4-172.8 12.3 23.4 44.1 36 69.3 36 106.2 0 153.9-103.5 153.9-196.8C384 71.3 298.2 6.5 204 6.5z" /></svg></span><span>pin</span></a><a aria-label="reddit-logo" target="_blank" rel="nofollow" href="http://www.reddit.com/submit?url=https%3A%2F%2Fcodeshive.com%2Fproduct%2Fhomework-3-bulletin-board-system-part-3-solved%2F&title=Homework%203%20%26%238211%3B%20Bulletin%20Board%20System%3A%20Part%203%20solved" class="ub-social-share-reddit-container"> <span class="social-share-icon ub-social-share-reddit"><svg xmlns="http://www.w3.org/2000/svg" style="fill:#ff4500" fill="#ff4500" width="20" height="20" viewBox="0 0 512 512"><path d="M440.3 203.5c-15 0-28.2 6.2-37.9 15.9-35.7-24.7-83.8-40.6-137.1-42.3L293 52.3l88.2 19.8c0 21.6 17.6 39.2 39.2 39.2 22 0 39.7-18.1 39.7-39.7s-17.6-39.7-39.7-39.7c-15.4 0-28.7 9.3-35.3 22l-97.4-21.6c-4.9-1.3-9.7 2.2-11 7.1L246.3 177c-52.9 2.2-100.5 18.1-136.3 42.8-9.7-10.1-23.4-16.3-38.4-16.3-55.6 0-73.8 74.6-22.9 100.1-1.8 7.9-2.6 16.3-2.6 24.7 0 83.8 94.4 151.7 210.3 151.7 116.4 0 210.8-67.9 210.8-151.7 0-8.4-.9-17.2-3.1-25.1 49.9-25.6 31.5-99.7-23.8-99.7zM129.4 308.9c0-22 17.6-39.7 39.7-39.7 21.6 0 39.2 17.6 39.2 39.7 0 21.6-17.6 39.2-39.2 39.2-22 .1-39.7-17.6-39.7-39.2zm214.3 93.5c-36.4 36.4-139.1 36.4-175.5 0-4-3.5-4-9.7 0-13.7 3.5-3.5 9.7-3.5 13.2 0 27.8 28.5 120 29 149 0 3.5-3.5 9.7-3.5 13.2 0 4.1 4 4.1 10.2.1 13.7zm-.8-54.2c-21.6 0-39.2-17.6-39.2-39.2 0-22 17.6-39.7 39.2-39.7 22 0 39.7 17.6 39.7 39.7-.1 21.5-17.7 39.2-39.7 39.2z" /></svg></span><span>post</span></a><a aria-label="tumblr-logo" target="_blank" rel="nofollow" href="https://www.tumblr.com/widgets/share/tool?canonicalUrl=https%3A%2F%2Fcodeshive.com%2Fproduct%2Fhomework-3-bulletin-board-system-part-3-solved%2F&title=Homework%203%20%26%238211%3B%20Bulletin%20Board%20System%3A%20Part%203%20solved" class="ub-social-share-tumblr-container"> <span class="social-share-icon ub-social-share-tumblr"><svg xmlns="http://www.w3.org/2000/svg" style="fill:#001935" fill="#001935" width="20" height="20" viewBox="0 0 320 512"><path d="M309.8 480.3c-13.6 14.5-50 31.7-97.4 31.7-120.8 0-147-88.8-147-140.6v-144H17.9c-5.5 0-10-4.5-10-10v-68c0-7.2 4.5-13.6 11.3-16 62-21.8 81.5-76 84.3-117.1.8-11 6.5-16.3 16.1-16.3h70.9c5.5 0 10 4.5 10 10v115.2h83c5.5 0 10 4.4 10 9.9v81.7c0 5.5-4.5 10-10 10h-83.4V360c0 34.2 23.7 53.6 68 35.8 4.8-1.9 9-3.2 12.7-2.2 3.5.9 5.8 3.4 7.4 7.9l22 64.3c1.8 5 3.3 10.6-.4 14.5z" /></svg></span><span>share</span></a></div> </div></div> </div> </div><!-- .footer-widgets.row-1 --> <div class="site-info"> © Codeshive 2024 <br /> <a class="privacy-policy-link" href="https://codeshive.com/privacy-policy/" rel="privacy-policy">Privacy Policy</a><span role="separator" aria-hidden="true"></span><a href="https://woocommerce.com" target="_blank" title="WooCommerce - The Best eCommerce Platform for WordPress" rel="noreferrer">Built with Storefront & WooCommerce</a>. </div><!-- .site-info --> <div class="storefront-handheld-footer-bar"> <ul class="columns-3"> <li class="my-account"> <a href="https://codeshive.com/my-account/">My Account</a> </li> <li class="search"> <a href="">Search</a> <div class="site-search"> <div class="widget woocommerce widget_product_search"><form role="search" method="get" class="woocommerce-product-search" action="https://codeshive.com/"> <label class="screen-reader-text" for="woocommerce-product-search-field-1">Search for:</label> <input type="search" id="woocommerce-product-search-field-1" class="search-field" placeholder="Search products…" value="" name="s" /> <button type="submit" value="Search" class="">Search</button> <input type="hidden" name="post_type" value="product" /> </form> </div> </div> </li> <li class="cart"> <a class="footer-cart-contents" href="https://codeshive.com/cart/">Cart <span class="count">0</span> </a> </li> </ul> </div> </div><!-- .col-full --> </footer><!-- #colophon --> <section class="storefront-sticky-add-to-cart"> <div class="col-full"> <div class="storefront-sticky-add-to-cart__content"> <img width="225" height="225" src="https://codeshive.com/wp-content/uploads/2021/01/download-8.jpg" class="attachment-woocommerce_thumbnail size-woocommerce_thumbnail" alt="" loading="lazy" /> <div class="storefront-sticky-add-to-cart__content-product-info"> <span class="storefront-sticky-add-to-cart__content-title">You're viewing: <strong>Homework 3 – Bulletin Board System: Part 3 solved</strong></span> <span class="storefront-sticky-add-to-cart__content-price"><span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span>40.00</span></span> </div> <a href="?add-to-cart=12768" class="storefront-sticky-add-to-cart__content-button button alt" rel="nofollow"> View This Answer </a> </div> </div> </section><!-- .storefront-sticky-add-to-cart --> </div><!-- #page --> <script type="application/ld+json">{"@context":"https:\/\/schema.org\/","@graph":[{"@context":"https:\/\/schema.org\/","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"item":{"name":"Home","@id":"https:\/\/codeshive.com"}},{"@type":"ListItem","position":2,"item":{"name":"Intro. to Network Programming","@id":"https:\/\/codeshive.com\/product-category\/intro-to-network-programming\/"}},{"@type":"ListItem","position":3,"item":{"name":"Homework 3 &#8211; Bulletin Board System: Part 3 solved","@id":"https:\/\/codeshive.com\/product\/homework-3-bulletin-board-system-part-3-solved\/"}}]},{"@context":"https:\/\/schema.org\/","@type":"Product","@id":"https:\/\/codeshive.com\/product\/homework-3-bulletin-board-system-part-3-solved\/#product","name":"Homework 3 - Bulletin Board System: Part 3 solved","url":"https:\/\/codeshive.com\/product\/homework-3-bulletin-board-system-part-3-solved\/","description":"Intro. to Network Programming\r\nDescription\r\nIn this part, you are going to write a client program for BBS service. However, in this part, the content of the\r\npost will store on the client-side (Amazon S3) instead of the server-side. Take the post function of the BBS service,\r\nfor example. The server in this part only stores the metadata of posts (e.g., post id, post title, author and date.)\r\nexcept for the content of the post. That is to say, each client has its storage to store the content of their posts,\r\nand we use Amazon S3 for the storage service. Besides, you are also going to implement new features such as a\r\nsimple mail service.\r\nSystem Architecture\r\nThe server here only stores user information, boards and some metadata of posts. (e.g., post id, post title,\r\netc). The real content of the post will store on the client-side (Amazon S3). Each bucket of Amazon S3\r\nrepresents the storage of each client. So, each client can store the content of its posts in its bucket, and this\r\nbucket is also an incoming mailbox for the mail service of this client. Note that only your client program can\r\nget access to Amazon S3 using Amazon S3 API.\r\nRequirements\r\nThe service can serve at least 10 clients. Your server and client program must be able to handle all commands\r\nin the previous part (output results must be the same as the previous part). For some commands such as\r\nwhoami, exit, logout, create-board, list-board ## and list-post ##, your client\r\nprogram only sends the command to the server and gets the corresponding result from the server. However, there\r\nare some commands that your client program will interact with Amazon S3. These commands are described as\r\nfollows:\r\nCommand format Description Result\r\nregister If successful execution, your client\r\nprogram will create a new bucket in\r\nAmazon S3 for this new user, and your\r\nserver program will store the bucket\r\nname of this new user so that the user\r\nwill be able to log in with its bucket in the\r\nfuture.\r\nIf failed, only print the error message.\r\nSuccess Register successfully.\r\nFail Username is already used.\r\nlogin If successful execution, the user will log\r\nin with its Amazon S3 bucket, so that it\r\ncan manipulate (e.g., upload posts,\r\ndelete posts, etc) its bucket in the future.\r\nIf failed, only print the error message.\r\nSuccess Welcome, .\r\nFail (1) Please logout first.\r\nFail (2) Login failed.\r\ncreate-post --title --\r\ncontent \r\n(command is in the same line )\r\nIf successful execution, the user (client)\r\nwill upload the content of this post to\r\nits S3 bucket using Amazon S3 API,\r\nand the server will keep the metadata of\r\nthis post.\r\nIf failed, only print the error message.\r\nSuccess Create post successfully.\r\nFail (1) Board does not exist.\r\nFail (2) Please login first.\r\nread Show the post whose ID is .\r\nIf successful execution, the client will\r\nget the content of this post from the\r\npost owner\u2019s bucket using Amazon S3\r\nAPI and print the result.\r\nIf failed, only print the error message.\r\nSuccess Author :\r\nTitle :\r\nDate :\r\n--\r\n\r\n--\r\n:\r\nFail Post does not exist.\r\ndelete-post Delete the post whose ID is .\r\nIf successful execution, the user (client)\r\nwill delete this post from its bucket,\r\nand the server will delete the metadata\r\nof this post.\r\nIf failed, only print the error message.\r\nSuccess Delete successfully.\r\nFail (1) Please login first.\r\nFail (2) Post does not exist.\r\nFail (3) Not the post owner.\r\nupdate-post --title\/content Update the post whose ID is .\r\nIf a successful update on the title, the\r\nserver will update the title of this post.\r\nIf a successful update on the content, the\r\nuser (client) will update the content of\r\nthis post in Amazon S3 using Amazon\r\nS3 API.\r\nIf failed, only print the error message.\r\nSuccess Update successfully.\r\nFail (1) Please login first.\r\nFail (2) Post does not exist.\r\nFail (3) Not the post owner.\r\ncomment Add a comment < comment > to the post\r\nwhose ID is .\r\nIf successful execution, the user (client)\r\nwill append the comment to the content\r\nof this post in the post owner\u2019s bucket.\r\nThat is to say, the comment stores in the\r\npost owner\u2019s bucket.\r\nIf failed, only print the error message.\r\nSuccess Comment successfully.\r\nFail (1) Please login first.\r\nFail (2) Post does not exist.\r\nAlso, there are some new commands you have to implement for simple mail service. These commands are\r\ndescribed as follows:\r\nCommand format Description Result\r\nmail-to --subject \r\n--content \r\n(command is in the same line )\r\nSend a mail whose subject is \r\nand content is to user\r\n.\r\nUse --subject and --content to separate\r\nsubject and content.\r\n has the same format as \r\nof the post.\r\n has the same format as\r\n of the post.\r\nIf successful execution, the user (client)\r\nwill create an object with in\r\nuser \u2019s bucket using\r\nAmazon S3 API.\r\nFailed execution:\r\nFail (1): No user logged in.\r\nFail (2): User doesn\u2019t exist.\r\nSuccess Sent successfully.\r\nFail (1) Please login first.\r\nFail (2) does not exist.\r\nlist-mail List all incoming mails of the current\r\nlogged in user.\r\nSuccess:\r\nNote that each user has its mail id\r\nsequence numbers. It should start at\r\n1.\r\nSuccess ID Subject From Date\r\n1 \r\n2 \r\nFail (1) Please login first.\r\n represents the subject of this\r\nmail.\r\n represents that this mail\r\nis sent by user .\r\n represents the sent date of this\r\nmail.\r\nThere is a \\t between each column.\r\nFailed execution:\r\nFail (1): No user logged in.\r\nretr-mail Retrieve the content of the mail \r\nIf successful execution, the user (client)\r\nwill get the content of the mail from its\r\nbucket using Amazon S3 API and print\r\nthe result.\r\n represents the subject of this\r\nmail.\r\n represents that this mail\r\nis sent by user .\r\n represents the sent date of this\r\nmail.\r\nThere is a \\t before \u2018:\u2019.\r\nFailed execution:\r\nFail (1): No user logged in.\r\nFail (2): Mail is not in your\r\nmailbox.\r\nSuccess Subject :\r\nFrom :\r\nDate :\r\n--\r\n\r\nFail (1) Please login first.\r\nFail (2) No such mail.\r\ndelete-mail Delete mail from your mailbox.\r\nIf successful execution, the user (client)\r\nwill delete the content of the mail from\r\nits bucket using Amazon S3 API.\r\nFailed execution:\r\nFail (1): No user logged in.\r\nFail (2): Mail is not in your\r\nmailbox.\r\nSuccess Mail deleted.\r\nFail (1) Please login first.\r\nFail (2) No such mail.\r\nScenario\r\nRun your server first, and run your client program to connect to your server. If the line only shows \u201c% \u201c, that means\r\nwe type in our client program. It is just for the height alignment of two columns here. You can ignore that.\r\nThe sample outputs of the client program are listed as follows:\r\nTerminal output Description and Amazon S3 Console State\r\nStart with nothing in your Amazon S3.\r\nbash$ .\/client 127.0.0.1 7890\r\n********************************\r\n** Welcome to the BBS server. **\r\n********************************\r\n% register Brad bb@cs.nctu.edu.tw 12345\r\nRegister successfully.\r\n%\r\nCreate a bucket for user Brad. You can name the bucket name\r\nof each user by yourself, but there are some limitations of the\r\nbucket name. Please refer to the Note part.\r\n% register Brad bb@cs.nctu.edu.tw 12345\r\nUsername is already used.\r\nJust print the error message. Nothing changes in Amazon S3.\r\n% register V v@cs.nctu.edu.tw bt21\r\nRegister successfully.\r\n%\r\n%\r\n%\r\n%\r\nCreate a bucket for user V.\r\n% login Brad 12345\r\nWelcome, Brad.\r\nThe client program will log in with Brad\u2019s bucket.\r\n% whoami\r\nBrad\r\nNothing changes in Amazon S3.\r\n% create-board NP_HW\r\nCreate board successfully.\r\nNothing changes in Amazon S3.\r\n% create-board NP_HW\r\nBoard already exist.\r\nNothing changes in Amazon S3.\r\n% list-board\r\n Index Name Moderator\r\n 1 NP_HW Brad\r\n%\r\n%\r\nNothing changes in Amazon S3.\r\n% list-board ##HW\r\n Index Name Moderator\r\n 1 NP_HW Brad\r\nNothing changes in Amazon S3.\r\n% create-post NP_HW --title NP_HW3 --content Err...Ha!\r\nCreate post successfully.\r\n%\r\n%\r\n%\r\n%\r\n%\r\n%\r\n%\r\n%\r\n%\r\nCreate an object to store the content of this post in Brad\u2019s\r\nbucket. By the way, you can name the object by yourself, but\r\nthere are some restrictions for object naming. Please refer to\r\nthe Note part.\r\n% create-post NCTU --title NP_HW3 --content Uh...\r\nBoard does not exist.\r\nNothing changes in Amazon S3.\r\n% create-post NP_HW --title NP_HW4 --content Wow...\r\nCreate post successfully.\r\n%\r\n%\r\n%\r\n%\r\n%\r\n%\r\n%\r\n%\r\nCreate a new post.\r\n% list-post NP\r\nBoard does not exist.\r\n%\r\n%\r\nNothing changes in Amazon S3.\r\n% list-post NP_HW\r\n ID Title Author Date\r\n 1 NP_HW3 Brad 04\/14\r\n 2 NP_HW4 Brad 04\/14\r\nNothing changes in Amazon S3.\r\n% list-post NP_HW ##HW3\r\n ID Title Author Date\r\n 1 NP_HW3 Brad 04\/14\r\nNothing changes in Amazon S3.\r\n% read 888\r\nPost does not exist.\r\n%\r\n%\r\n%\r\nNothing changes in Amazon S3.\r\n% read 1\r\n Author :Brad\r\n Title :NP_HW3\r\n Date :2020-04-14\r\n --\r\n Err...\r\n Ha!\r\n --\r\nGet the content of post 1 from the post owner\u2019s bucket.\r\n% update-post 888 --title NP HW_4\r\nPost does not exist.\r\nNothing changes in Amazon S3.\r\n% update-post 1 --title NP HW_4\r\nUpdate successfully.\r\n%\r\n%\r\n%\r\n%\r\n%\r\n%\r\n%\r\n%\r\n%\r\n%\r\nThe state of Amazon S3 may be unchanged. It depends on your\r\ndesign. But for my design, I changed the object key of that post.\r\n% read 1\r\n Author :Brad\r\n Title :NP HW_4\r\n Date :2020-04-14\r\n --\r\n Err...\r\n Ha!\r\n --\r\nGet the content of post 1 from the post owner\u2019s bucket.\r\n% update-post 1 --content Yeah!\r\nUpdate successfully.\r\nUpdate the content of this post in Amazon S3.\r\n% read 1\r\n Author :Brad\r\n Title :NP HW_4\r\n Date :2020-04-14\r\n --\r\n Yeah!\r\n --\r\nGet the content of post 1 from the post owner\u2019s bucket.\r\n% logout\r\nBye, Brad.\r\nNothing changes in Amazon S3.\r\n% whoami Nothing changes in Amazon S3.\r\nPlease login first.\r\n% logout\r\nPlease login first.\r\nNothing changes in Amazon S3.\r\n% login V bt21\r\nWelcome, V.\r\nThe client program will login with V\u2019s bucket.\r\n% create-post NP_HW --title Hello --content I amV.\r\nCreate post successfully.\r\n%\r\n%\r\n%\r\n%\r\n%\r\n%\r\n%\r\n% update-post 1 --content Ha!ha!\r\nNot the post owner.\r\nNothing changes in Amazon S3.\r\n% delete-post 1\r\nNot the post owner.\r\nNothing changes in Amazon S3.\r\n% comment 888 Ha ha!\r\nPost does not exist.\r\nNothing changes in Amazon S3.\r\n% comment 1 Ha ha!\r\nComment successfully.\r\n%\r\nThe client program will append the comment to the\r\ncorresponding post object (e.g., NP_HW_4-\r\n1586850747968524907 object in Brad\u2019s bucket) in Amazon S3.\r\n% read 1\r\n Author :Brad\r\n Title :NP HW_4\r\n Date :2020-04-14\r\n --\r\n Yeah!\r\n --\r\n V:Ha ha!\r\nGet the content of post 1 from the post owner\u2019s bucket.\r\n% mail-to TT --subject Hi TT --content Hi TT!\r\nTT does not exist.\r\nNothing changes in Amazon S3.\r\n% mail-to Brad --subject Hi Brad --content Hi Brad!\r\nSent successfully.\r\n% mail-to Brad --subject Hey --content Hey Brad!\r\nSent successfully.\r\n%\r\n%\r\n%\r\n%\r\n%\r\nUser V creates two email objects in Brad\u2019s bucket.\r\n% list-mail\r\n ID Subject From Date\r\nNothing changes in Amazon S3.\r\n% delete-mail 1\r\nNo such mail.\r\nNothing changes in Amazon S3.\r\n% retr-mail 1\r\nNo such mail.\r\nNothing changes in Amazon S3.\r\n% logout\r\nBye, V.\r\nNothing changes in Amazon S3.\r\n% login Brad 12345\r\nWelcome, Brad.\r\nThe client program will login with Brad\u2019s bucket.\r\n% list-mail\r\n ID Subject From Date\r\n 1 Hi Brad V 04\/14\r\n 2 Hey V 04\/14\r\nNothing changes in Amazon S3.\r\n% retr-mail 1\r\n Subject :Hi Brad\r\n From :V\r\n Date :2020-04-14\r\n --\r\n Hi\r\n Brad!\r\nGet the content of the mail from his bucket.\r\n% mail-to V --subject Hi V --content WoW V!\r\nSent successfully.\r\n%\r\n%\r\n%\r\n%\r\n%\r\n%\r\n%\r\nUser Brad creates a mail object in V\u2019s bucket.\r\n% logout\r\nBye, Brad.\r\nNothing changes in Amazon S3.\r\n% login V bt21\r\nWelcome, V.\r\nThe client program will login with V\u2019s bucket.\r\n% list-mail\r\n ID Subject From Date\r\n 1 Hi V Brad 04\/14\r\nNothing changes in Amazon S3. But note that user V has its\r\nmail id sequence number. It starts at 1.\r\n% logout\r\nBye, V.\r\nNothing changes in Amazon S3.\r\n% login Brad 12345\r\nWelcome, Brad.\r\nThe client program will login with Brad\u2019s bucket.\r\n% list-mail\r\n ID Subject From Date\r\n 1 Hi Brad V 04\/14\r\n 2 Hey V 04\/14\r\nNothing changes in Amazon S3.\r\n% delete-mail 1\r\nMail deleted.\r\n%\r\n%\r\n%\r\n%\r\n%\r\n%\r\n%\r\n%\r\n%\r\nUser Brad deletes the object corresponding to his mail 1 from\r\nhis bucket.\r\n% list-mail\r\n ID Subject From Date\r\n 1 Hey V 04\/14\r\nNothing changes in Amazon S3. But note that ID of the mail with\r\nthe subject \u201cHey\u201d is 1.\r\n% logout\r\nBye, Brad.\r\nNothing changes in Amazon S3.\r\n% exit Nothing changes in Amazon S3.\r\nNote\r\n1. About bucket naming:\r\n\u2022 Bucket names must be unique across all existing bucket names in Amazon S3.\r\n\u2022 Bucket names must be at least 3 and no more than 63 characters long.\r\n\u2022 Bucket names must not contain uppercase characters or underscores.\r\n\u2022 Bucket names must start with a lowercase letter or number.\r\n2. About object key name:\r\n\u2022 Unique identifier within a bucket. If you upload the same key name object without versioning-enabled, it will\r\noverwrite the original one.\r\n\u2022 The following character sets are generally safe for use in key names.\r\nFor more details about buckets and objects, you can refer to reference [5][6]\r\n3. About AWS API access key:\r\nIf you want to use AWS SDK to make Amazon S3 API calls, you have to provide your AWS credential first.\r\nHow to set up authentication credential:\r\nCreate a credential file at ~\/.aws\/credentials. The content of this file is described as follows:\r\n[default]\r\naws_access_key_id=\r\naws_secret_access_key=\r\naws_session_token=\r\nYou can get these key from your AWS Educate account. Log in your account and go to Intro. to Network\r\nProgramming classroom. Then, you will see the following page.\r\nClick Account Details\r\nClick Show and copy those keys into ~\/.aws\/credentials\r\nThe credential we use here is temporary, so you have to copy and paste again when the credential\r\nexpiration.\r\n4. About C++ AWS SDK:\r\nTo use the AWS SDK for C++, you need:\r\n\u26ab Visual Studio 2015 or later\r\n\u26ab or GNU Compiler Collection (GCC) 4.9 or later\r\n\u26ab or Clang 3.3 or later\r\n\u26ab A minimum of 4 GB of RAM\r\nSo, if you currently use Amazon EC2 with instance type of t2.micro, please change to at least t2.medium.\r\nMoreover, please backup all your environment when you are running out of classroom credits. We suggest\r\nyou write a script to set up your environment. It will save a lot of time.\r\nHow to change instance type:\r\nRight-click your original instance -> Instance Settings -> Change Instance Type\r\n5. You can use any code examples in the Amazon S3 API documentation to manipulate your Amazon\r\nS3.\r\nGrade (100%)\r\nFor those commands that interact with Amazon S3, we will check your Amazon S3 console. If the state of\r\nyour Amazon S3 is wrong, we will deduct some scores of that command.\r\n\u26ab register command \u2013 (8%)\r\n\u26ab login command \u2013 (8%)\r\n\u26ab create-post command \u2013 (8%)\r\n\u26ab read command \u2013 (8%)\r\n\u26ab delete-post command \u2013 (8%)\r\n\u26ab update-post command \u2013 (8%)\r\n\u26ab comment command \u2013 (8%)\r\n\u26ab mail-to command \u2013 (8%)\r\n\u26ab list-mail command \u2013 (8%)\r\n\u26ab retr-mail command \u2013 (8%)\r\n\u26ab delete-mail command \u2013 (8%)\r\n\u26ab list-post command \u2013 (5%)\r\n\u26ab logout command \u2013 (2%)\r\n\u26ab exit command \u2013 (2%)\r\n\u26ab whoami command \u2013 (1%)\r\n\u26ab create-board command \u2013 (1%)\r\n\u26ab list-board command \u2013 (1%)\r\nSubmission\r\nPlease upload a zip file called \u201chw3_{$student_id}.zip\u201d (e.g., hw3_0856020.zip) that includes your source code. It\r\nmust include at least your server source code and client source code. Submission that doesn\u2019t follow the rule\r\nwill get 20% punishment on the grade.\r\nYou will get 0 points on this project for plagiarism. Please don\u2019t copy-paste other students\u2019 code!\r\nReference\r\n1. C\/C++ Socket\r\n2. SQLite C\/C++ Interface\r\n3. Linux socket SELECT\r\n4. AWS SDK supported languages\r\n5. Bucket Restrictions and Limitations\r\n6. Object Key and Metadata\r\n7. AWS Command Line Interface\r\n8. AWS SDK for C++\r\n9. AWS SDK for Python\r\n10. Sequence diagram reference","image":"https:\/\/codeshive.com\/wp-content\/uploads\/2021\/01\/download-8.jpg","sku":12768,"offers":[{"@type":"Offer","price":"40.00","priceValidUntil":"2025-12-31","priceSpecification":{"price":"40.00","priceCurrency":"USD","valueAddedTaxIncluded":"false"},"priceCurrency":"USD","availability":"http:\/\/schema.org\/InStock","url":"https:\/\/codeshive.com\/product\/homework-3-bulletin-board-system-part-3-solved\/","seller":{"@type":"Organization","name":"Codeshive","url":"https:\/\/codeshive.com"}}]}]}</script> <div class="pswp" tabindex="-1" role="dialog" aria-hidden="true"> <div class="pswp__bg"></div> <div class="pswp__scroll-wrap"> <div class="pswp__container"> <div class="pswp__item"></div> <div class="pswp__item"></div> <div class="pswp__item"></div> </div> <div class="pswp__ui pswp__ui--hidden"> <div class="pswp__top-bar"> <div class="pswp__counter"></div> <button class="pswp__button pswp__button--close" aria-label="Close (Esc)"></button> <button class="pswp__button pswp__button--share" aria-label="Share"></button> <button class="pswp__button pswp__button--fs" aria-label="Toggle fullscreen"></button> <button class="pswp__button pswp__button--zoom" aria-label="Zoom in/out"></button> <div class="pswp__preloader"> <div class="pswp__preloader__icn"> <div class="pswp__preloader__cut"> <div class="pswp__preloader__donut"></div> </div> </div> </div> </div> <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap"> <div class="pswp__share-tooltip"></div> </div> <button class="pswp__button pswp__button--arrow--left" aria-label="Previous (arrow left)"></button> <button class="pswp__button pswp__button--arrow--right" aria-label="Next (arrow right)"></button> <div class="pswp__caption"> <div class="pswp__caption__center"></div> </div> </div> </div> </div> <script> (function () { var c = document.body.className; c = c.replace(/woocommerce-no-js/, 'woocommerce-js'); document.body.className = c; })(); </script> <link rel='stylesheet' id='wc-blocks-style-css' href='https://codeshive.com/wp-content/plugins/woocommerce/assets/client/blocks/wc-blocks.css?ver=wc-9.2.3' media='all' /> <style id='jetpack-block-contact-info-inline-css'> .wp-block-jetpack-contact-info{margin-bottom:1.5em} </style> <script src="https://codeshive.com/wp-includes/js/dist/hooks.min.js?ver=2810c76e705dd1a53b18" id="wp-hooks-js"></script> <script src="https://codeshive.com/wp-includes/js/dist/i18n.min.js?ver=5e580eb46a90c2b997e6" id="wp-i18n-js"></script> <script id="wp-i18n-js-after"> wp.i18n.setLocaleData( { 'text direction\u0004ltr': [ 'ltr' ] } ); </script> <script src="https://codeshive.com/wp-content/plugins/contact-form-7/includes/swv/js/index.js?ver=5.9.8" id="swv-js"></script> <script id="contact-form-7-js-extra"> var wpcf7 = {"api":{"root":"https:\/\/codeshive.com\/wp-json\/","namespace":"contact-form-7\/v1"},"cached":"1"}; </script> <script src="https://codeshive.com/wp-content/plugins/contact-form-7/includes/js/index.js?ver=5.9.8" id="contact-form-7-js"></script> <script id="kk-star-ratings-js-extra"> var kk_star_ratings = {"action":"kk-star-ratings","endpoint":"https:\/\/codeshive.com\/wp-admin\/admin-ajax.php","nonce":"547622f134"}; </script> <script src="https://codeshive.com/wp-content/plugins/kk-star-ratings/src/core/public/js/kk-star-ratings.min.js?ver=5.4.8" id="kk-star-ratings-js"></script> <script src="https://codeshive.com/wp-content/plugins/pinterest-pin-it-button-on-image-hover-and-post/js/main.js?ver=6.6.1" id="wl-pin-main-js"></script> <script id="wl-pin-main-js-after"> jQuery(document).ready(function(){jQuery(".is-cropped img").each(function(){jQuery(this).attr("style", "min-height: 120px;min-width: 100px;");});jQuery(".avatar").attr("style", "min-width: unset; min-height: unset;");}); </script> <script id="awdr-main-js-extra"> var awdr_params = {"ajaxurl":"https:\/\/codeshive.com\/wp-admin\/admin-ajax.php","nonce":"156ca866db","enable_update_price_with_qty":"show_when_matched","refresh_order_review":"0","custom_target_simple_product":"","custom_target_variable_product":"","js_init_trigger":"","awdr_opacity_to_bulk_table":"","awdr_dynamic_bulk_table_status":"0","awdr_dynamic_bulk_table_off":"on","custom_simple_product_id_selector":"","custom_variable_product_id_selector":""}; </script> <script src="https://codeshive.com/wp-content/plugins/woo-discount-rules/v2/Assets/Js/site_main.js?ver=2.6.5" id="awdr-main-js"></script> <script src="https://codeshive.com/wp-content/plugins/woo-discount-rules/v2/Assets/Js/awdr-dynamic-price.js?ver=2.6.5" id="awdr-dynamic-price-js"></script> <script id="wp-statistics-tracker-js-extra"> var WP_Statistics_Tracker_Object = {"requestUrl":"https:\/\/codeshive.com\/wp-json\/wp-statistics\/v2","ajaxUrl":"https:\/\/codeshive.com\/wp-admin\/admin-ajax.php","hitParams":{"wp_statistics_hit":1,"source_type":"product","source_id":12768,"search_query":"","signature":"ecfe3d286abac1764b65d0955ded8db5","endpoint":"hit"},"onlineParams":{"wp_statistics_hit":1,"source_type":"product","source_id":12768,"search_query":"","signature":"ecfe3d286abac1764b65d0955ded8db5","endpoint":"online"},"option":{"userOnline":"1","consentLevel":"","dntEnabled":"1","bypassAdBlockers":"","isWpConsentApiActive":false,"trackAnonymously":false,"isPreview":false},"jsCheckTime":"60000"}; </script> <script src="https://codeshive.com/wp-content/plugins/wp-statistics/assets/js/tracker.js?ver=14.10" id="wp-statistics-tracker-js"></script> <script id="storefront-navigation-js-extra"> var storefrontScreenReaderText = {"expand":"Expand child menu","collapse":"Collapse child menu"}; </script> <script src="https://codeshive.com/wp-content/themes/storefront/assets/js/navigation.min.js?ver=4.2.0" id="storefront-navigation-js"></script> <script src="https://codeshive.com/wp-content/plugins/woocommerce/assets/js/sourcebuster/sourcebuster.min.js?ver=9.2.3" id="sourcebuster-js-js"></script> <script id="wc-order-attribution-js-extra"> var wc_order_attribution = {"params":{"lifetime":1.0e-5,"session":30,"base64":false,"ajaxurl":"https:\/\/codeshive.com\/wp-admin\/admin-ajax.php","prefix":"wc_order_attribution_","allowTracking":true},"fields":{"source_type":"current.typ","referrer":"current_add.rf","utm_campaign":"current.cmp","utm_source":"current.src","utm_medium":"current.mdm","utm_content":"current.cnt","utm_id":"current.id","utm_term":"current.trm","utm_source_platform":"current.plt","utm_creative_format":"current.fmt","utm_marketing_tactic":"current.tct","session_entry":"current_add.ep","session_start_time":"current_add.fd","session_pages":"session.pgs","session_count":"udata.vst","user_agent":"udata.uag"}}; </script> <script src="https://codeshive.com/wp-content/plugins/woocommerce/assets/js/frontend/order-attribution.min.js?ver=9.2.3" id="wc-order-attribution-js"></script> <script src="https://codeshive.com/wp-content/themes/storefront/assets/js/woocommerce/header-cart.min.js?ver=4.2.0" id="storefront-header-cart-js"></script> <script src="https://codeshive.com/wp-content/themes/storefront/assets/js/footer.min.js?ver=4.2.0" id="storefront-handheld-footer-bar-js"></script> <script src="https://codeshive.com/wp-content/plugins/easy-remove-footer-credit/script.js?ver=6.6.1" id="jaberfc_script-js"></script> <script src="https://stats.wp.com/e-202436.js" id="jetpack-stats-js" data-wp-strategy="defer"></script> <script id="jetpack-stats-js-after"> _stq = window._stq || []; _stq.push([ "view", JSON.parse("{\"v\":\"ext\",\"blog\":\"188646962\",\"post\":\"12768\",\"tz\":\"0\",\"srv\":\"codeshive.com\",\"j\":\"1:13.8\"}") ]); _stq.push([ "clickTrackerInit", "188646962", "12768" ]); </script> <script id="wc-cart-fragments-js-extra"> var wc_cart_fragments_params = {"ajax_url":"\/wp-admin\/admin-ajax.php","wc_ajax_url":"\/?wc-ajax=%%endpoint%%","cart_hash_key":"wc_cart_hash_d3b9954c221eecec8f775f707ac06f5d","fragment_name":"wc_fragments_d3b9954c221eecec8f775f707ac06f5d","request_timeout":"5000"}; </script> <script src="https://codeshive.com/wp-content/plugins/woocommerce/assets/js/frontend/cart-fragments.min.js?ver=9.2.3" id="wc-cart-fragments-js" defer data-wp-strategy="defer"></script> <script src="https://codeshive.com/wp-includes/js/dist/vendor/wp-polyfill.min.js?ver=3.15.0" id="wp-polyfill-js"></script> <script id="jetpack-blocks-assets-base-url-js-before"> var Jetpack_Block_Assets_Base_Url="https://codeshive.com/wp-content/plugins/jetpack/_inc/blocks/"; </script> <script src="https://codeshive.com/wp-content/plugins/jetpack/_inc/blocks/contact-info/view.js?minify=false&ver=13.8" id="jetpack-block-contact-info-js"></script> <script id="storefront-sticky-add-to-cart-js-extra"> var storefront_sticky_add_to_cart_params = {"trigger_class":"entry-summary"}; </script> <script src="https://codeshive.com/wp-content/themes/storefront/assets/js/sticky-add-to-cart.min.js?ver=4.2.0" id="storefront-sticky-add-to-cart-js"></script> <!-- WooCommerce JavaScript --> <script type="text/javascript"> jQuery(function($) { _wca.push({'_en': 'woocommerceanalytics_product_view','blog_id': '188646962', 'ui': 'null', 'url': 'https://codeshive.com', 'woo_version': '9.2.3', 'store_admin': '0', 'device': 'desktop', 'template_used': '0', 'additional_blocks_on_cart_page': [],'additional_blocks_on_checkout_page': [],'store_currency': 'USD', 'cart_page_contains_cart_block': '0', 'cart_page_contains_cart_shortcode': '1', 'checkout_page_contains_checkout_block': '0', 'checkout_page_contains_checkout_shortcode': '1', 'pi': '12768', 'pn': 'Homework 3 - Bulletin Board System: Part 3 solved', 'pc': 'Intro. to Network Programming', 'pp': '40', 'pt': 'simple', }); }); </script> </body> </html> <!-- Page cached by LiteSpeed Cache 6.5.0.2 on 2024-09-07 13:49:02 -->