C# 클래스 Squishy.Network.ConnectionWriter

The ConnectionWriter provides several methods to send continuous data from a Stream. When either the Connection disconnects, reading fails or no more data can be read, the stream will be closed after the corresponding event has been raised if CloseStreamAfterTranscaction is set to true - otherwise left open.
파일 보기 프로젝트 열기: jaddie/WCell-Utility-Bot

공개 프로퍼티들

프로퍼티 타입 설명
CloseStreamAfterTransaction bool

공개 메소드들

메소드 설명
ConnectionWriter ( ) : System
ConnectionWriter ( Connection con ) : System
Stop ( ) : void

Stops reading and -if CloseStreamAfterTransaction is true- also closes the underlying stream.

WriteAll ( Stream stream ) : void

If not writing yet, asynchronously sends everything that can be read from this stream.

WriteFile ( FileInfo file ) : void

If not writing yet, opens a readonly-stream to the given file and will asynchronously send it to the remote connection.

비공개 메소드들

메소드 설명
ContinueReadStreamData ( ) : void
DataReadFailedNotify ( Exception e ) : void
DataSentNotify ( ) : void
InitWrite ( Stream stream ) : void
OnInternalDisconnected ( Connection con, bool conLost ) : void
OnInternalSent ( Connection con, int amount, bool hasReamining ) : void
OnStreamRead ( IAsyncResult ar ) : void
ResetAfterTransfer ( ) : void

메소드 상세

ConnectionWriter() 공개 메소드

public ConnectionWriter ( ) : System
리턴 System

ConnectionWriter() 공개 메소드

public ConnectionWriter ( Connection con ) : System
con Connection
리턴 System

Stop() 공개 메소드

Stops reading and -if CloseStreamAfterTransaction is true- also closes the underlying stream.
public Stop ( ) : void
리턴 void

WriteAll() 공개 메소드

If not writing yet, asynchronously sends everything that can be read from this stream.
public WriteAll ( Stream stream ) : void
stream Stream
리턴 void

WriteFile() 공개 메소드

If not writing yet, opens a readonly-stream to the given file and will asynchronously send it to the remote connection.
public WriteFile ( FileInfo file ) : void
file FileInfo
리턴 void

프로퍼티 상세

CloseStreamAfterTransaction 공개적으로 프로퍼티

Indicates wether to close the Stream when failed or finished reading. Default: true
public bool CloseStreamAfterTransaction
리턴 bool