public RequestWrite ( byte handle, ulong serverOffset, byte data, int offset, int length, |
||
handle | byte | The handle. |
serverOffset | ulong | The the zero-based offset (in bytes) relative to the beginning of the file that the write must start at. |
data | byte | The buffer holding the data to write. |
offset | int | the zero-based offset in |
length | int | The length (in bytes) of the data to write. |
wait | The wait event handle if needed. | |
writeCompleted | Action |
The callback to invoke when the write has completed. |
Résultat | void |
public void RequestWrite(byte[] handle,
ulong serverOffset,
byte[] data,
int offset,
int length,
AutoResetEvent wait,
Action<SftpStatusResponse> writeCompleted = null)
{
SshException exception = null;
var request = new SftpWriteRequest(ProtocolVersion, NextRequestId, handle, serverOffset, data, offset,
length, response =>
{
if (writeCompleted != null)
{
writeCompleted(response);
}
exception = GetSftpException(response);
if (wait != null)
wait.Set();
});
SendRequest(request);
if (wait != null)
WaitOnHandle(wait, OperationTimeout);
if (exception != null)
{
throw exception;
}
}