Developing ASP.NET MVC Web Applications — Question 173
You are developing an ASP.NET MVC application that displays stock market information.
The stock market information updates frequently and must be displayed in real-time.
You need to eliminate unnecessary header data, minimize latency, and transmit data over a full-duplex connection.
What should you do?
Answer options
- A. Implement long-running HTTP requests.
- B. Instantiate a MessageChannel object on the client.
- C. Implement WebSockets protocol on the client and the server.
- D. Configure polling from the browser.
Correct answer: C
Explanation
The correct solution is to implement the WebSockets protocol on both the client and server, as it allows for real-time, full-duplex communication with minimal latency and overhead. Long-running HTTP requests (A) and polling (D) are not efficient for real-time updates, while a MessageChannel (B) does not provide the necessary full-duplex capabilities that WebSockets do.