91精品国产91久久久久久_国产精品二区一区二区aⅴ污介绍_一本久久a久久精品vr综合_亚洲视频一区二区三区

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

代寫UDP Client-Server application java程序

時間:2024-02-21  來源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯




Programming Assignment 1

Objective of this assignment:

.     Develop and implement a simple application using UDP sockets. The client must be implemented in Java. The server can be implemented in Java or in your preferred 1 language (different from Java) for a 5 points bonus. Insure that your preferred language is already installed and available on Tux machines. It is your responsibility to check ahead: do not check/test at the last minute.

What you need to do:

1.   Implement a simple UDP Client-Server application

Objective:

The objective is to implement a simple client-server application using a safe method: start from working code for the client and the server. You must slowly and carefully bend (modify) little by little the client and server alternatively until you achieve your ultimate goal: meeting all requirements for this assignment. You must bend and expand each piece alternatively the way a black-smith forges iron. From time to time save your working client and server such that you can roll-back to the latest working code in case of bugs. Not using this "baby steps" strategy may leave you with a ball of wax hard to debug.

For this programming assignment, you are advised (optional, not mandatory) to start from the Friend client and server code (see lecture and resources) to implement this simple application. The Friend app was presented during the lectures. Consider using Wireshark to check whether the protocols you implement meet this assignment requirements. If using a language other than Java for the server, you are on your own. Ensure that your preferred language is already available on Tux machines. It is your responsibility to timely check. Start ahead. Do not wait until the last minute.

Hint: look at how to “ How to get started?” below

Part A: Datagram socket programming

The objective is to design a Calculating Server (CS). This calculating server performs bitwise  Boolean and arithmetic computations requested by a client on signed integers. Your server must offer the following operations:  1) addition (+), subtraction (-), 3) bitwise OR (|), 4) bitwise AND (&), 5) division (/), and 6) multiplication (*).

A client will form a request  following  this protocol (byte per byte):



TML

Op Code

Operand 1

Operand 2

Request ID

Op Name Length

Op Name

Size (bytes)

1

1

4

4

2

1

Variable

Where

1) TML is the Total Message Length (in bytes) including TML. It is an integer representing the total number of bytes in the request.

2) Op Code is a number specifying the desired operation following this table

Operation

*

/

|

&

-

+

OpCode

0

1

2

3

4

5

3) Operand  1 is a signed number making the first operand

4) Operand 2 is a signed number making the second operand

5) Request ID is the request ID. This number is generated by the client to differentiate requests. You may use a variable randomly initialized and incremented each time a request is generated.

6) Op  Name Length is the length in bytes of the operation name (see below what the Operation Name is).  Pay attention: the length is the number of bytes used to encode the string. Recall that some encoding schemes use two bytes per character.

7) Op   Name is   name   of   the   requested  operation:   "addition",   "subtraction",  "or",  "and",  "division",  and "multiplication". The Op Name string must be encoded using "UTF- 16BE".

Operands are sent in the network byte order (i.e., big endian).

Hint: create a class object Request like "Friend", but with the fields needed for a request ...

Below are two examples of requests. Bytes in the array are hexadecimal numbers.

Request 1: suppose the Client requests to perform the OR operation 240 | 4: (This is the 5th request) (240) 10  = 0xF0 and (4) 10  = 0x04. We omit the “0x” prefix for each byte expressed in hexadecimal.

11 02 00 00 00 F0 00 00 00 04 00 05 04 0**F 00 72

Request 2: suppose the Client requests to perform the operation 227 &  183  (if this is the  12th  request):

13 03 00 00 00 E3 00 00 00 B7 00 0C 06 0**1 0**E 0**4

The Server will respond with a message with this format:

Total Message Length (TML)

Result

Error Code

Request ID

one byte

4 byte

1 byte

2 byte

Where

1) TML is the Total  Message Length (in bytes) including TML. It is an integer representing the total numbers of bytes in the message.

2) Result is the result of the requested operation

3) Error Code is 0 if the request was valid, and 127 if the request was invalid (Message length not matching TML)  4) Request ID is the request ID. This number is the number that was sent as Request ID in the request sent by the

client. This will allow the client to match the results to the appropriate request.

In response to Request 1 (240 | 4) below

11 02 00 00 00 F0 00 00 00 04 00 05 04 0**F 00 72

the server will send back: (. We omit the “0x” prefix for each byte expressed in hexadecimal. )

08 00 00 00 F4 00 00 05

In response to Request 2 (227 &  183 ),

13 03 00 00 00 E3 00 00 00 B7 00 0C 06 0**1 0**E 0**4

the server would send back:

08 00 00 00 A3 00 00 0C

a) Repetitive Server: Write a datagram Calculating Server (ServerUDP.xxx). This server must respond to requests as described above. The server must bind to port (10010+TID) and could run on any  machine  accessible  on the  Internet. TID is  your  Canvas  team  #. The  server  must  accept  a command line of the form: prog ServerUDP portnumber where prog is the executable, portnumber is the port the server binds to. For example, if your Team ID (GID) is Team  13 then your server must bind to Port #  10023.

Whenever a server gets a request, it must:

i.   display the request one byte at a time in hexadecimal (for debugging and grading purpose)

ii.   display the request in a manner convenient for a typical Internet user: the request ID and the request (operands and required operation)

b)   Inplement a datagram client (ClientUDP.xxx)

i.   Accepts a command line of the form: prog ClientUDP servername PortNumber where prog is the executable, servername is the servername, and PortNumber is the port number of the server. Your program must prompt the user to ask for an Opcode, Operand1 and Operand2 where OpCode is the opcode of the requested operation (See the opcode table). Operand1 and Operand2 are the operands. For each entry from the user, your program must perform the following operations:

ii.   form a request as described above

iii.   display byte per byte in hexadecimal the request that will be sent

iv.   send the request to the server and wait for a response

v.   display the server’s response byte per byte in hexadecimal (for debugging and grading purpose)

vi.   display the  response of the server  in a manner convenient for a typical Internet user: the request ID, the response and the error code (display Ok when error code is 0)

vii.   display the roundtrip time (time between the transmission of the request and the reception of the response)

viii.   prompt the user for a new request. (Use some way to allow a client to quit. Just be explicit about how to quit)

To implement the server, you should consider (optional) starting with the Friend code. If you implement a successful server in a language different from Java, you will get 5 points Bonus points. For the language other than Java, the only constraint is that it must already be installed on Tux machines. Check the Tux machines for your chosen language before you start implementing.

Your code must be neat and pleasant to read. Comment the code appropriately. If starting from some  other  code, delete all   unnecessary   instructions (do not  just comment  out the   unnecessary instructions). A code not neat or pleasant will be penalized up to -30 points.

Data collection and analysis

For the client, report separately the min, average, and max round trip time. Include screenshots of your client and server executing on the Tux machines. Screenshots on machines other than the Tux machines will not receive any credit. To receive any credit, the screenshots must clearly show the Tux machine name, the username of one of the classmates, and the date. In other words, if any information (username, date, or tux machine name) is missing, the assigned credit for the assignment will be 0. You must have two screenshots: one for the server and one for the client. Here is a screenshot containing the Tux machine, a username, and a date. Avoid screenshots too small. If screenshots are not easily and conveniently readable, they will be considered missing. Screenshots must be easily and conveniently readable.



How to get started?

1) Download all files (UDP sockets) to run the "Friend" application used in Module 2 to illustrate how any class object can be exchanged: Friend.java, FriendBinConst.java, FriendEncoder.java, FriendEncoderBin.java, FriendDecoder.java, FriendDecoderBin.java, SendUDP.java, and RecvUDP.java.

2) Compile these files and execute the UDP server and client. Ensure they work.

3) Create a new folder called Request and duplicate inside it ALL files related to the Friend class object     4) Inside the Folder Request, change ALL occurrences of "Friend" with "Request" including the file names. 3) Adapt each file to your application. Replace the fields used by Friend with the fields used by a request.

4) Aim to have the client send one request and have the server understand it (just like what we did with a friend object).

5) When your server will receive and print out correctly a request, then you need to send back a response... 6) Create a class object Response....

Report (a missing report incurs a 30 points penalty)

.     Write a report that will report your results..

.     Your report must contain the following information:

o  whether the programs work or not (this must be just ONE sentence)

o  the directions to compile and execute your programs

o  the information this assignment asks you to report (minimum, average, and maximum round trip times) and the

required screenshots of the execution of the client and server. To receive any credit, the screenshots must clearly show the Tux machine, the username of one of the classmates, and the date. To get the date, just run the command date before executing your programs. Each missing or incomplete screenshot will result in a 50 points penalty.

What you need to turn in:

.      Electronic copy of your source programs (standalone, i.e. NOT in a zipped folder)

.      Electronic copy of the report (including your answers) (standalone, i.e. NOT in a zipped folder). Submit the file as a Microsoft Word or PDF file.

. In addition, put all files in a zipped folder and submit the zipped folder.

Grading

1) Client is worth 40% if it works well:

a) meets the protocol specifications (20%) and the user interface ( 10%)

b) communicates correctly with YOUR server (10%). Furthermore, screenshots of your client and server running on Tux machines must be provided. The absence of screenshots or Screenshots on machines other than the Tux machines will incur 50 points penalty per missing screenshot

2) UDP client is worth  10% if it works well with a working server from any of your classmates.

The server is graded the same as the client (30% +  10% +  10%).
請加QQ:99515681  郵箱:99515681@qq.com   WX:codehelp 

掃一掃在手機(jī)打開當(dāng)前頁
  • 上一篇:代寫3D printer materials estimation編程
  • 下一篇:代寫 Behavioural Economics ECON3124
  • 無相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務(wù)-企業(yè)/產(chǎn)品研發(fā)/客戶要求/設(shè)計優(yōu)化
    有限元分析 CAE仿真分析服務(wù)-企業(yè)/產(chǎn)品研發(fā)
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計優(yōu)化
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計優(yōu)化
    出評 開團(tuán)工具
    出評 開團(tuán)工具
    挖掘機(jī)濾芯提升發(fā)動機(jī)性能
    挖掘機(jī)濾芯提升發(fā)動機(jī)性能
    海信羅馬假日洗衣機(jī)亮相AWE  復(fù)古美學(xué)與現(xiàn)代科技完美結(jié)合
    海信羅馬假日洗衣機(jī)亮相AWE 復(fù)古美學(xué)與現(xiàn)代
    合肥機(jī)場巴士4號線
    合肥機(jī)場巴士4號線
    合肥機(jī)場巴士3號線
    合肥機(jī)場巴士3號線
  • 短信驗證碼 目錄網(wǎng) 排行網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號-3 公安備 42010502001045

    91精品国产91久久久久久_国产精品二区一区二区aⅴ污介绍_一本久久a久久精品vr综合_亚洲视频一区二区三区
    91精品国产综合久久香蕉的特点| 亚洲va中文字幕| 国产精品av一区二区| 综合av第一页| 老鸭窝91久久精品色噜噜导演| 蜜臀99久久精品久久久久久软件 | 欧美久久久久久蜜桃| www.亚洲免费av| 亚洲人成网站在线| 欧美最猛性xxxxx直播| 成人免费va视频| 中文字幕一区二区三区在线不卡 | 2欧美一区二区三区在线观看视频| 欧美成人蜜桃| 亚洲成人av福利| 制服丝袜成人动漫| 欧美1区2区视频| 亚洲成在人线免费| 91精品一区二区三区在线观看| 91蜜桃视频在线| 亚洲成人自拍一区| 7777女厕盗摄久久久| 欧美黄免费看| 日本成人在线视频网站| 2023国产精品| 另类亚洲自拍| 99久久国产免费看| 亚洲成人黄色小说| 欧美mv日韩mv| 国产乱码精品| 国产+成+人+亚洲欧洲自线| 亚洲视频在线一区| 欧美午夜寂寞影院| 欧美日韩在线高清| 久久国产生活片100| 国产日本欧美一区二区| 色吧成人激情小说| 欧美日韩天天操| 日韩成人免费在线| 国产婷婷色一区二区三区在线| 久久这里只有| 欧美日韩免费观看一区| 精品一区二区三区欧美| 亚洲精品高清在线| 精品国产一区二区三区av性色| 免费在线观看成人av| 99精品视频中文字幕| 视频一区视频二区中文| 日本一区二区三区高清不卡| 欧美优质美女网站| 亚洲激情一区| 91丨porny丨首页| 久久99国内精品| 亚洲精品成a人| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 一区二区三国产精华液| 久久免费视频一区| 欧美日韩一区二区不卡| 国产日韩欧美三级| 精品亚洲国产成人av制服丝袜| 国产精品女上位| 日韩精品最新网址| 欧美三级韩国三级日本一级| 中国成人亚色综合网站| 91天堂素人约啪| 国产一区二区中文字幕| 亚洲18色成人| 国产精品国产自产拍高清av王其| 91精品国产品国语在线不卡| 一本色道久久综合狠狠躁的推荐| 伊人久久大香线蕉综合热线| 99r国产精品| 国产成人免费9x9x人网站视频| 日本视频一区二区| 亚洲一区二区成人在线观看| 国产精品久久毛片| 国产日韩三级在线| 精品国精品自拍自在线| 欧美精品乱码久久久久久按摩| 久久综合中文| 亚洲一区日本| 在线视频亚洲| 在线精品亚洲| 黑丝一区二区| 国产精品xxx在线观看www| av激情成人网| 成人精品小蝌蚪| 成人午夜免费视频| 国产激情精品久久久第一区二区 | 午夜精品福利久久久| 亚洲国产一区二区视频| 亚洲一区二区三区中文字幕| 亚洲六月丁香色婷婷综合久久 | 色国产精品一区在线观看| 久久久av水蜜桃| 久久久精品日韩| 色综合久久99| 色成年激情久久综合| 在线视频一区二区三| 91国产精品成人| 欧美色视频一区| 7777精品伊人久久久大香线蕉经典版下载 | 欧美一级夜夜爽| 精品国产免费人成电影在线观看四季| 欧美一区二区福利在线| 日韩欧美在线一区二区三区| 日韩欧美电影一区| www亚洲一区| 亚洲国产高清不卡| 国产精品国产自产拍高清av王其| 中文字幕一区二区三区在线不卡| 国产精品国产自产拍高清av王其| 亚洲天堂福利av| 亚洲综合免费观看高清完整版在线 | 中日韩视频在线观看| 国产精品普通话对白| 久久精品1区| 欧美日韩午夜影院| 精品乱人伦小说| 中文字幕乱码亚洲精品一区| 国产精品免费丝袜| 亚洲国产一区二区在线播放| 日本三级亚洲精品| 国产精品一区二区不卡| 91在线观看美女| 亚洲国产一区二区精品专区| 新67194成人永久网站| 在线免费亚洲电影| 日韩午夜在线观看| 亚洲国产成人自拍| 亚洲福利视频一区| 极品少妇xxxx精品少妇| 成人精品免费看| 亚洲婷婷免费| 久久精品九九| 欧美精品久久一区| 国产日韩欧美麻豆| 亚洲成av人片一区二区三区| 激情图区综合网| 欧美精品综合| 亚洲欧美日韩精品一区二区| 欧美日韩高清一区二区| 久久久一区二区| 亚洲综合激情另类小说区| 狠狠色丁香久久婷婷综| 欧美黄色一区| 久久综合九色综合欧美狠狠| 日韩午夜精品视频| 亚洲欧美国产三级| 韩国精品免费视频| 狠狠色噜噜狠狠色综合久| 在线免费观看日本欧美| 久久久亚洲精品石原莉奈 | 亚洲国产cao| 成人午夜av影视| 在线综合视频| 日韩免费一区二区| 亚洲与欧洲av电影| 成人av中文字幕| 国产精品亚洲综合久久| 欧美大片拔萝卜| 亚洲综合色丁香婷婷六月图片| 国产精品羞羞答答xxdd| 一本久道久久综合狠狠爱| 欧美夫妻性生活| 一区二区三区在线免费播放| 国产高清在线精品| 亚洲一区日韩在线| 久久你懂得1024| 日韩1区2区日韩1区2区| 国产一区二区在线观看免费播放| 欧美三级日韩三级| 亚洲欧美日韩国产综合在线| 国产.精品.日韩.另类.中文.在线.播放| 亚洲人成久久| 精品理论电影在线| 免费观看91视频大全| 精品999网站| 日韩欧美在线不卡| 偷拍亚洲欧洲综合| 国产精品国码视频| 欧美一级艳片视频免费观看| 午夜精品在线看| 国自产拍偷拍福利精品免费一 | 婷婷亚洲久悠悠色悠在线播放| 午夜性色一区二区三区免费视频| 欧美色区777第一页| 亚洲一区二区五区| 欧美精品播放| 日韩欧美美女一区二区三区| 日韩激情av在线| 亚洲乱码久久| 国产欧美中文在线| 成人永久aaa| 欧美日韩国产美| 日韩黄色在线观看| 国产日韩一区二区三区在线播放 | 337p亚洲精品色噜噜狠狠| 日韩精品电影在线| 99国产精品|