Click or drag to resize

StreamWrapper Class

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.
Inheritance Hierarchy
SystemObject
  Sportradar.SDK.Common.UtilsStreamWrapper

Namespace: Sportradar.SDK.Common.Utils
Assembly: Common (in Common.dll) Version: 2.28.0.0
Syntax
C#
public class StreamWrapper

The StreamWrapper type exposes the following members.

Constructors
 NameDescription
Public methodStreamWrapperInitializes a new instance of the StreamWrapper class
Top
Properties
Methods
 NameDescription
Public methodClose 
Public methodEquals
(Overrides ObjectEquals(Object))
Public methodFlush 
Public methodGetHashCode
(Overrides ObjectGetHashCode)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodRead 
Public methodToString
(Overrides ObjectToString)
Public methodWrite 
Top
Remarks
This implementation of stream wrapper is not thread safe.
See Also