98-372 · Question #71
Which class provides methods for sending and receiving data over Stream sockets in blocking mode?
The correct answer is B. NetworkStream class. The NetworkStream class provides methods for sending and receiving data over Stream sockets in blocking mode. It can be used for both synchronous as well as asynchronous data transfer. This class does not support random access to the network data stream. However, read and write…
Question
Which class provides methods for sending and receiving data over Stream sockets in blocking mode?
Options
- AStream class
- BNetworkStream class
- CNetStream class
- DMemoryStream class
How the community answered
(34 responses)- A12% (4)
- B82% (28)
- D6% (2)
Explanation
The NetworkStream class provides methods for sending and receiving data over Stream sockets in blocking mode. It can be used for both synchronous as well as asynchronous data transfer. This class does not support random access to the network data stream. However, read and write operations can be executed at the same time on a NetworkStream class instance without the need for synchronization. Answer: A is incorrect. The Stream class offers a generic view of a sequence of bytes. Answer: D is incorrect. The MemoryStream class is contained in the System.IO namespace. It inherits the Stream class. It reads and writes a stream of data in bytes to a memory instead of a disk. It stores data as an unsigned byte array, which is initialized when a MemoryStream object is created. An advantage of the MemoryStream class is that it saves data storage in buffers and Answer: C is incorrect. There is no such class as NetStream in the System.IO namespace.
Topics
Community Discussion
No community discussion yet for this question.