public override async Task<OutputStruct> SendReceiveAsync(ProtocalUnit unit, InputStruct content) { if (!ProtocalLinker.IsConnected) { if (connectTryCount > 10) return null; return await await ConnectAsync().ContinueWith(answer => answer.Result ? base.SendReceiveAsync(unit, content) : null); } return await base.SendReceiveAsync(unit, content); }
public override async Task <OutputStruct> SendReceiveAsync(ProtocalUnit unit, InputStruct content) { if (ProtocalLinker != null && ProtocalLinker.IsConnected) { return(await base.SendReceiveAsync(unit, content)); } if (_connectTryCount > 10) { return(null); } return(await await ConnectAsync().ContinueWith(answer => answer.Result ? base.SendReceiveAsync(unit, content) : null)); }
private async Task <OutputStruct> ForceSendReceiveAsync(ProtocalUnit unit, InputStruct content) { return(await base.SendReceiveAsync(unit, content)); }
public override OutputStruct SendReceive(ProtocalUnit unit, InputStruct content) { return(AsyncHelper.RunSync(() => SendReceiveAsync(unit, content))); }
private async Task<OutputStruct> ForceSendReceiveAsync(ProtocalUnit unit, InputStruct content) { return await base.SendReceiveAsync(unit, content); }
public override OutputStruct SendReceive(ProtocalUnit unit, InputStruct content) { return AsyncHelper.RunSync(() => SendReceiveAsync(unit, content)); }