CSSE2310/CSSE7231 Assignment
Electrical Engineering
项目类别:计算机

Hello, dear friend, you can consult us at any time if you have any questions, add  WeChat:  zz-x2580


Information Technology and Electrical Engineering

CSSE2310/CSSE7231
Assignment 
Marks: 75 (for CSSE2310), 85 (for CSSE7231)
Weighting: 15%
Due: 4:00pm Friday 3 June, 2022
Introduction 1
The goal of this assignment is to further develop your C programming skills, and to demonstrate your under- 2
standing of networking and multithreaded programming. You are to create two programs. One – dbserver 3
– is a networked database server that takes requests from clients, allowing them to store, retrieve and delete 4
string-based key/value pairs. The other – dbclient – is a simple network client that can query the database 5
managed by dbserver. Communication between the dbclient and dbserver is done using HTTP requests and 6
responses, using a simple RESTful API. Advanced functionality such as authentication, connection limiting, 7
signal handling and statistics reporting are also required for full marks. 8
The assignment will also test your ability to code to a particular programming style guide, to write a library 9
to a provided API, and to use a revision control system appropriately. 10
Student Conduct 11
This is an individual assignment. You should feel free to discuss general aspects of C programming and 12
the assignment specification with fellow students, including on the discussion forum. In general, questions like 13
“How should the program behave if 〈this happens〉?” would be safe, if they are seeking clarification on the 14
specification. 15
You must not actively help (or seek help from) other students or other people with the actual design, structure 16
and/or coding of your assignment solution. It is cheating to look at another student’s assignment code 17
and it is cheating to allow your code to be seen or shared in printed or electronic form by others. 18
All submitted code will be subject to automated checks for plagiarism and collusion. If we detect plagiarism or 19
collusion, formal misconduct actions will be initiated against you, and those you cheated with. That’s right, if 20
you share your code with a friend, even inadvertently, then both of you are in trouble. Do not post your 21
code to a public place such as the course discussion forum or a public code repository, and do not allow others 22
to access your computer - you must keep your code secure. 23
You must follow the following code referencing rules for all code committed to your SVN repository (not 24
just the version that you submit): 25
Code Origin Usage/Referencing
Code provided to you in writing this semester by
CSSE2310/7231 teaching staff (e.g. code hosted on Black-
board, posted on the discussion forum, or shown in class).
May be used freely without reference. (You must be able
to point to the source if queried about it.)
Code you have personally written this semester for
CSSE2310/7231 (e.g. code written for A1 reused in A3)
May be used freely without reference. (This assumes
that no reference was required for the original use.)
Code examples found in man pages on moss.
May be used provided the source of the code is
referenced in a comment adjacent to that code.
Code you have personally written in a previous enrolment
in this course or in another ITEE course and where that
code has not been shared or published.
Code (in any programming language) that you have taken
inspiration from but have not copied.
Other code – includes: code provided by teaching staff only
in a previous offering of this course (e.g. previous A1 solu-
tion); code from websites; code from textbooks; any code
written by someone else; and any code you have written
that is available to other students.
May not be used. If the source of the code is referenced
adjacent to the code then this will be considered code
without academic merit (not misconduct) and will be
removed from your assignment prior to marking (which
may cause compilation to fail). Copied code without
adjacent referencing will be considered misconduct and
action will be taken.
26
6959462-30065-6649710
Uploading or otherwise providing the assignment specification or part of it to a third party including online 27
tutorial and contract cheating websites is considered misconduct. The university is aware of these sites and 28
they cooperate with us in misconduct investigations. 29
The course coordinator reserves the right to conduct interviews with students about their submissions, for 30
the purposes of establishing genuine authorship. If you write your own code, you have nothing to fear from this 31
process. If you are not able to adequately explain your code or the design of your solution and/or be able to 32
make simple modifications to it as requested at the interview, then your assignment mark will be scaled down 33
based on the level of understanding you are able to demonstrate. 34
In short - Don’t risk it! If you’re having trouble, seek help early from a member of the teaching staff. 35
Don’t be tempted to copy another student’s code or to use an online cheating service. You should read and 36
understand the statements on student misconduct in the course profile and on the school web-site: https: 37
//www.itee.uq.edu.au/itee-student-misconduct-including-plagiarism 38
Specification – dbclient 39
The dbclient program provides a commandline interface to allow access to a subset of the dbserver’s capabil- 40
ities, in particular it permits only the setting and retrieving of key/value pairs. It does not support dbserver 41
authentication, or deletion of key/value pairs. Note that you will need to read the dbserver specification 42
below also to fully understand how the programs communicate. 43
dbclient does not need to be multithreaded. 44
Command Line Arguments 45
Your dbclient program is to accept command line arguments as follows: 46
./dbclient portnum key [value] 47
• The portnum argument indicates which localhost port dbserver is listening on – either numerical or the 48
name of a service. 49
• The key argument specifies the key to be read or written. 50
• The value argument, if provided, specifies the value to be written to the database for the corresponding 51
key. If value is not provided, then dbclient will read the value from the database. 52
• Any additional arguments are to be silently ignored. 53
dbclient Behaviour 54
If insufficient command line arguments are provided then dbclient should emit the following message (termi- 55
nated by a newline) to stderr and exit with status 1: 56
Usage: dbclient portnum key [value]
If the correct number of arguments is provided, then further errors are checked for in the order below. 57
Restrictions on the key value 58
The key value must not contain any spaces or newlines. If it does then dbclient should emit the following 59
message (terminated by a newline) to stderr and exit with status 1: 60
dbclient: key must not contain spaces or newlines
Connection error 61
If dbclient is unable to connect to the server on the specified port of localhost, it shall emit the following 62
message (terminated by a newline) to stderr and exit with status 2: 63
dbclient: unable to connect to port N
where N should be replaced by the argument given on the command line. 64
6959462-30065-6649710
GETting key/value pairs 65
If no value argument is specified, then dbclient shall send a GET HTTP request to the dbserver for the 66
specified key in the public database. The HTTP request will look like this: 67
GET /public/ HTTP/1.1
where is replaced by the requested database key. Note that the request (first) line must be terminated by 68
a carriage-return line-feed (CRLF) sequence (CRLF = \r\n) and be followed by a similarly-terminated blank 69
line. There is no body part necessary in the request. 70
If the server returns a 200 (OK) response, then dbclient shall emit the returned value string to stdout 71
(with a terminating newline), and exit with status 0. 72
If the server returns any other response (e.g. 404 Not Found) or the connection with the server is lost, then 73
dbclient shall emit no output, and exit with status 3. 74
PUTting key/value pairs 75
If value is specified, then dbclient shall attempt to set the corresponding key/value pair, using a PUT HTTP 76
request as follows (see the Communication protocol section below for details): 77
PUT /public/ HTTP/1.1
Content-Length:

where and are replaced with the required key and value strings respectively, and is replaced 78
by the number of bytes in . As always, lines in a HTTP request should be terminated by a CRLF 79
sequence. The body part of the request must be the unmodified value part of the key-value pair – no newlines 80
are present unless they are part of the value. 81
If the server returns a 200 (OK) response, then dbclient shall exit with status 0. If the server returns any 82
other response (e.g. 404 Not Found or 503 Service Unavailable) or the connection with the server is lost, then 83
dbclient shall exit with status 4. 84

留学ICU™️ 留学生辅助指导品牌
在线客服 7*24 全天为您提供咨询服务
咨询电话(全球): +86 17530857517
客服QQ:2405269519
微信咨询:zz-x2580
关于我们
微信订阅号
© 2012-2021 ABC网站 站点地图:Google Sitemap | 服务条款 | 隐私政策
提示:ABC网站所开展服务及提供的文稿基于客户所提供资料,客户可用于研究目的等方面,本机构不鼓励、不提倡任何学术欺诈行为。