// sends an request to the remote server (async) private void SendRequestAsync(string name, Uri remotePath, FileTransferCallback callback, DelegateRequest caller) { try { caller.BeginInvoke(name, remotePath, delegate(IAsyncResult iar) { var c = (DelegateRequest)iar.AsyncState; c.EndInvoke(iar); callback.Invoke(FileTransferResult.Success); }, caller); } catch (Exception e) { ErrorLog.Add(this, e.Message); callback.Invoke(FileTransferResult.Failure); } }