2

芒果 SDK 中不包含 NetworkStream 类吗?它似乎不在 System.Net 程序集中,但可能在其他地方。如果它不可用(我想知道为什么)什么是一个好的选择?最好的方法是自己实现它吗?

4

1 回答 1

3

It doesn't appear to be in the System.Net.Sockets namespace, so I guess you're out of luck. If I were to hazard a guess, I'd say it wasn't included because Stream exposes blocking read/write methods and they preferred to exclude NetworkStream entirely rather than have them throw a NotSupportedException.

Having a stream also implies that you can use StreamReader, which wouldn't be true due to the lack of blocking read/writes.

于 2011-06-08T21:33:40.527 回答