Developing ASP.NET MVC Web Applications — Question 27
You are developing an ASP.NET MVC application that provides instant messaging capabilities to customers.
You have the following requirements:
✑ Messages must be able to be sent and received simultaneously.
✑ Latency and unnecessary header data must be eliminated.
✑ The application must comply with HTML5 standards.
You need to design the application to meet the requirements.
What should you do?
Answer options
- A. Configure polling from the browser.
- B. Implement long-running HTTP requests.
- C. Implement WebSockets protocol on the client and the server.
- D. Instantiate a MessageChannel object on the client.
Correct answer: D
Explanation
The correct answer is D because the MessageChannel object allows for efficient, bi-directional communication between the client and server, which aligns with HTML5 standards and fulfills the requirements of simultaneous message sending and receiving. Options A and B do not provide the same level of efficiency and responsiveness as a MessageChannel, while option C, although useful, is not the most suitable choice given the specific needs stated in the requirements.