///<summary>Called when we received the REST response.</summary> ///<param name="ar">The result of the asynchronous operation.</param> private void OnRestQuerySent(IAsyncResult ar) { try { if (DestinationFtpSocket.EndSend(ar) == -1) { Dispose(); return; } DestinationFtpSocket.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, new AsyncCallback(this.OnRestQueryRecv), DestinationFtpSocket); } catch { Dispose(); } }
///<summary>Called when we begin receive the data.</summary> ///<param name="ar">The result of the asynchronous operation.</param> private void OnFtpQuerySent(IAsyncResult ar) { try { if (DestinationFtpSocket.EndSend(ar) == -1) { Dispose(); return; } StartRelay(); } catch { Dispose(); } }