C# Class System.Net.CommandStream

Inheritance: PooledStream
Datei anzeigen Open project: dotnet/corefx Class Usage Examples

Protected Properties

Property Type Description
_abortReason string
_commands PipelineEntry[]
_index int
_isAsync bool
_request WebRequest

Private Properties

Property Type Description
Abort void
CheckContinuePipeline void
CommandStream System.IO
PostReadCommandProcessing bool
PostSendCommandProcessing bool
ReadCallback void
ReceiveCommandResponse ResponseDescription
ReceiveCommandResponseCallback void
SubmitRequest Stream
WriteCallback void

Protected Methods

Method Description
BuildCommandsList ( WebRequest request ) : PipelineEntry[]
CheckValid ( ResponseDescription response, int &validThrough, int &completeLength ) : bool

This function is implemented in a derived class to determine whether a response is valid, and when it is complete.

ClearState ( ) : void
ContinueCommandPipeline ( ) : Stream
Dispose ( bool disposing ) : void
GenerateException ( FtpStatusCode code, string statusDescription, Exception innerException ) : Exception
GenerateException ( string message, WebExceptionStatus status, Exception innerException ) : Exception
InitCommandPipeline ( WebRequest request, PipelineEntry commands, bool isAsync ) : void
InvokeRequestCallback ( object obj ) : void
MarkAsRecoverableFailure ( ) : void
PipelineCallback ( PipelineEntry entry, ResponseDescription response, bool timeout, Stream &stream ) : PipelineInstruction

Private Methods

Method Description
Abort ( Exception e ) : void
CheckContinuePipeline ( ) : void
CommandStream ( TcpClient client ) : System.IO
PostReadCommandProcessing ( Stream &stream ) : bool
PostSendCommandProcessing ( Stream &stream ) : bool
ReadCallback ( IAsyncResult asyncResult ) : void
ReceiveCommandResponse ( ) : ResponseDescription

Kicks off an asynchronous or sync request to receive a response from the server. Uses the Encoding encoding to transform the bytes received into a string to be returned in the GeneralResponseDescription's StatusDescription field.

ReceiveCommandResponseCallback ( ReceiveState state, int bytesRead ) : void

ReceiveCommandResponseCallback is the main "while loop" of the ReceiveCommandResponse function family. In general, what is does is perform an EndReceive() to complete the previous retrieval of bytes from the server (unless it is using a buffered response) It then processes what is received by using the implementing class's CheckValid() function, as described above. If the response is complete, it returns the single complete response in the GeneralResponseDescription created in BeginReceiveComamndResponse, and buffers the rest as described above. If the response is not complete, it issues another Connection.BeginReceive, with callback ReceiveCommandResponse2, so the action will continue at the next invocation of ReceiveCommandResponse2.

SubmitRequest ( WebRequest request, bool isAsync, bool readInitalResponseOnConnect ) : Stream
WriteCallback ( IAsyncResult asyncResult ) : void

Method Details

BuildCommandsList() protected method

protected BuildCommandsList ( WebRequest request ) : PipelineEntry[]
request WebRequest
return PipelineEntry[]

CheckValid() protected method

This function is implemented in a derived class to determine whether a response is valid, and when it is complete.
protected CheckValid ( ResponseDescription response, int &validThrough, int &completeLength ) : bool
response ResponseDescription
validThrough int
completeLength int
return bool

ClearState() protected method

protected ClearState ( ) : void
return void

ContinueCommandPipeline() protected method

protected ContinueCommandPipeline ( ) : Stream
return Stream

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

GenerateException() protected method

protected GenerateException ( FtpStatusCode code, string statusDescription, Exception innerException ) : Exception
code FtpStatusCode
statusDescription string
innerException System.Exception
return System.Exception

GenerateException() protected method

protected GenerateException ( string message, WebExceptionStatus status, Exception innerException ) : Exception
message string
status WebExceptionStatus
innerException System.Exception
return System.Exception

InitCommandPipeline() protected method

protected InitCommandPipeline ( WebRequest request, PipelineEntry commands, bool isAsync ) : void
request WebRequest
commands PipelineEntry
isAsync bool
return void

InvokeRequestCallback() protected method

protected InvokeRequestCallback ( object obj ) : void
obj object
return void

MarkAsRecoverableFailure() protected method

protected MarkAsRecoverableFailure ( ) : void
return void

PipelineCallback() protected method

protected PipelineCallback ( PipelineEntry entry, ResponseDescription response, bool timeout, Stream &stream ) : PipelineInstruction
entry PipelineEntry
response ResponseDescription
timeout bool
stream Stream
return PipelineInstruction

Property Details

_abortReason protected_oe property

protected string _abortReason
return string

_commands protected_oe property

protected PipelineEntry[] _commands
return PipelineEntry[]

_index protected_oe property

protected int _index
return int

_isAsync protected_oe property

protected bool _isAsync
return bool

_request protected_oe property

protected WebRequest,System.Net _request
return WebRequest