Question: In Java, follow this protocol to write a UDP Server program: here is the flow: USAGE messages Running output client sends the following to port
In Java, follow this protocol to write a UDP Server program: here is the flow:

USAGE messages

Running output

client sends the following to port P on a server H : [the number 1 as a network order 2-byte integer, "hello, i am name (id)"] server sends: [the number 1 as a network order 2-byte integer, conversation number as a network order 4-byte integer, "hello, i am > "] client sends a file to the server in 100-byte chunks, except for the last chunk possibly with: [the number 2 as a network order 2-byte integer, conversation number as a network order 4-byte integer, offset of bytes as a network order 4-byte integer, bytes of the file]. the file will be name_of_the_sender.txt. the server will acknowledge receipt with [the number 2 as a network order 2-byte integer, conversation number as a network order 4-byte integer, offset of bytes as a network order 4-byte integer] once the file has be transferred the client will send the checksum using: [the number 3 as a network order 2-byte integer, conversation number as a network order 4-byte integer, the first 8 bytes of the SHA-256 digest] the server will respond with: [the number 3 as a network order 2-byte integer, conversation number as a network order 4-byte integer, one byte of 0 for success or 1 for failure, failure message if any] the server may also send back a message: [the number 5 as a network order 2-byte integer, an error message] for timeouts (more than 10 seconds to send the next message), bad messages, or other unexpected errors. all the usage messages will write to stderr and will exit with a code of 2 \% java -cp ... edu.sjsu.cs158a.HelloUDPServer Missing required parameter: '' Usage: HelloUDPServer A UDP server that implements the HelloUDP protocol. port to listen on. \% java -cp ... edu.sjsu.cs158a.HelloUDPServer -1 port must be a number between and 65535 Usage: HelloUDPServer A UDP server that implements the HelloUDP protocol. port to listen on. \% java -cp ... edu.sjsu.cs158a.HelloUDPServer what goes here port must be a number between 0 and 65535 Usage: HelloUDPServer A UDP server that implements the HelloUDP protocol. port to listen on. \% java -cp ... edu.sjsu.cs158a.HelloUDPServer 4 goes here Unmatched arguments from index 1: 'goes', 'here' Usage: HelloUDPServer A UDP server that implements the HelloUDP protocol. port to listen on. when the code successfully starts, it should print all messages to stdout. the first message will be "Listening on port ": \% java -cp target/cs158a-sp23-1.0-SNAPSHOT-jar-with-dependencies.jar edu.sjsu.cs158a.HereUDPServer 2323 Listening on port 2323 every time a message is received the follow line should print: for example: when a message is sent the following line should print: for example
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
