Home / Expert Answers / Computer Science / modify-the-server-code-that-can-handle-multiple-connections-at-the-same-time-to-handle-specific-comm-pa385

(Solved): Modify the server code that can handle multiple connections at the same time to handle specific COMM ...



Modify the server code that can handle multiple connections at the same time to handle specific COMMANDS sent from the client. A particular command, in this task, is “Date”.

Type “Date” in the Client, which will be sent to the Server, the server should respond with the Current Day, Date and Time (in its Current Time-Zone, e.g., KL).

This should be presented as a single line, that is terminated with a carriage return (ASCII code 13) and line feed (ASCII code 10).

Example of output: Wed Nov 30 17:00:54 2023 GMT + 8
Another particular command, in this task, is “Time” and a code of a time-zone.

Typing “Time” in the Client, which will be sent to the Server, the server should respond with only the Current Time (in the Current Time-Zone, which is in “Malaysia” time).

Typing, for example, “Time GMT” in the Client, which will be sent to the Server, the server should respond with the Current Time (in the GMT Time-Zone). List of acceptable time-zones and the associated offset from GMT (in hours), is available in Table 1, below. Please assume that the server is based in Malaysia, hence, you would need to modify the offsets in accordance with the current time-zone, so that the returned times are correct.

If any other Time-Zone codes provided, the server should respond with “ERROR” string.

Write it in C.

student submitted image, transcription available below

\begin{tabular}{|c|c|} \hline Time-zone Command & Offset from GMT (in hours) \\ \hline PST & -8 \\ \hline MST & -7 \\ \hline CST & -6 \\ \hline EST & -5 \\ \hline GMT & 0 \\ \hline CET & +1 \\ \hline MSK & +3 \\ \hline JST & +9 \\ \hline AEDT & +11 \\ \hline \end{tabular}


We have an Answer from Expert

View Expert Answer

Expert Answer



We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe