| StreamWrapper |
Another workaround for a .NET bug
(http://social.msdn.microsoft.com/Forums/en-US/netfxnetcom/thread/f4c3d019-aecd-4fc6-9dea-680f04faa900)
NetworkStream
- non-blocking Read() returns 0 bytes when there is nothing to read
- IOException when "the underlying Socket is closed." -> reconnect
- Write() is thread-safe
SslStream
- >non-blocking Read() throws IOException -> no need to reconnect
-
after the exception a subsequent non-blocking Read() (when there is
nothing to read) returns 5 bytes of SSL keep-alive data (23 3 1 0 17)
23 is TLS application protocol, 3 1 means TLS 1.0, 3 0 would be SSL 3.0
- Write() is NOT thread-safe
Unify the behavior to NetworkStream behavior.
|