C# Класс IronSmarkets.Sockets.SafeSslStream

The purpose of this class is to wrap SslStream and provide thread-safe Read and Write blocking operations. The reason this is necessary is because NetworkStream is thread-safe for simultaneous reads and writes as long as there is a single reader and a single writer. SslStream, on the other hand, does not guarantee this safety. However, we can use BeginRead/BeginWrite to do asynchronous operations and simply signal to the main thread that they've completed. Performance will suffer slightly, but TLS network performance incurs its own buffering penalties by nature.
Наследование: Stream
Показать файл Открыть проект

Открытые методы

Метод Описание
Flush ( ) : void
Read ( byte buffer, int offset, int count ) : int
SafeSslStream ( SslStream stream ) : System
Seek ( long offset, SeekOrigin origin ) : long
SetLength ( long length ) : void
Write ( byte buffer, int offset, int count ) : void

Приватные методы

Метод Описание
ReadCallback ( IAsyncResult ar ) : void
WriteCallback ( IAsyncResult ar ) : void

Описание методов

Flush() публичный Метод

public Flush ( ) : void
Результат void

Read() публичный Метод

public Read ( byte buffer, int offset, int count ) : int
buffer byte
offset int
count int
Результат int

SafeSslStream() публичный Метод

public SafeSslStream ( SslStream stream ) : System
stream System.Net.Security.SslStream
Результат System

Seek() публичный Метод

public Seek ( long offset, SeekOrigin origin ) : long
offset long
origin SeekOrigin
Результат long

SetLength() публичный Метод

public SetLength ( long length ) : void
length long
Результат void

Write() публичный Метод

public Write ( byte buffer, int offset, int count ) : void
buffer byte
offset int
count int
Результат void