C# Class J9Updater.FileTransferSvc.Ver1.TcpFileTransmitServiceClient

Mostrar archivo Open project: zlphoenix/LearnCSharp Class Usage Examples

Private Properties

Property Type Description
After2ndHandshakeCallback void
AfterReadFileToBuffer void
AfterSendDownloadRequest void
BeginTransmit void
Close void
CloseConnectionCallBack void
ContinueReceiveDownloadFileCallback void
CreateDir void
DownLoadFinishingCallBack void
DownLoadWriteFileCallBack void
GetDownloadFileSize void
GetFileName string
HandshakeSendCallback void
ReceiveDownloadHandshakeCallback void
ResponseCallBack void
RetryConnect void
SendDownloadHandshakeMsg void
SendFileCallBack void
SendHandshakeMsg void
WriteFile void

Public Methods

Method Description
DownLoad ( string filePath, Action callback ) : void
TcpFileTransmitServiceClient ( ) : System
Upload ( string filePath, Action callback ) : void

Private Methods

Method Description
After2ndHandshakeCallback ( IAsyncResult ar ) : void
AfterReadFileToBuffer ( IAsyncResult ar ) : void

读取文件到Buffer,并发起文件传送

AfterSendDownloadRequest ( IAsyncResult ar ) : void
BeginTransmit ( FileTransmitState state ) : void

启动异步读取文件

Close ( ) : void
CloseConnectionCallBack ( IAsyncResult ar ) : void

结束传输并执行回调

ContinueReceiveDownloadFileCallback ( IAsyncResult ar ) : void
CreateDir ( string filePath ) : void
DownLoadFinishingCallBack ( IAsyncResult ar ) : void
DownLoadWriteFileCallBack ( IAsyncResult ar ) : void
GetDownloadFileSize ( FileTransmitState state ) : void
GetFileName ( ) : string
HandshakeSendCallback ( IAsyncResult ar ) : void

发送消息成功后,接受来自服务端的响应

ReceiveDownloadHandshakeCallback ( IAsyncResult ar ) : void
ResponseCallBack ( IAsyncResult ar ) : void

接受响应并启动文件传送

RetryConnect ( ) : void

执行失败的重传处理

SendDownloadHandshakeMsg ( IAsyncResult ar ) : void
SendFileCallBack ( IAsyncResult ar ) : void

当前块传输完成后处理后续块或者接受服务端响应

SendHandshakeMsg ( IAsyncResult ar ) : void

建立连接后,发送握手消息

WriteFile ( FileTransmitState state ) : void

Method Details

DownLoad() public method

public DownLoad ( string filePath, Action callback ) : void
filePath string
callback Action
return void

TcpFileTransmitServiceClient() public method

public TcpFileTransmitServiceClient ( ) : System
return System

Upload() public method

public Upload ( string filePath, Action callback ) : void
filePath string
callback Action
return void