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
파일 보기 프로젝트 열기: smarkets/IronSmarkets

공개 메소드들

메소드 설명
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