public void SendServiceExternalError() { if (connection == null) { throw new InvalidOperationException("Access denied!"); } if (id == ServiceProtocolDataContract.RequestIdWithoutResponse) { throw new InvalidOperationException("This request is not associated with any response!"); } connection.Send(id, new ServiceProtocolInternalResponse { Code = ServiceProtocolResponseCode.RemoteServiceExternalError }); connection = null; }
public void SendResponse(ServiceProtocolResponse response) { if (response == null) { throw new ArgumentNullException(nameof(response)); } if (connection == null) { throw new InvalidOperationException("Access denied!"); } if (id == ServiceProtocolDataContract.RequestIdWithoutResponse) { throw new InvalidOperationException("This request is not associated with any response!"); } connection.Send(id, response); connection = null; }