Copilot commented on code in PR #4000:
URL: https://github.com/apache/thrift/pull/4000#discussion_r4200654190


##########
lib/netstd/Thrift/Transport/Layered/TFramedTransport.cs:
##########
@@ -53,6 +53,52 @@ public TFramedTransport(TTransport transport)
             InitWriteBuffer();
         }
 
+        /// <summary>
+        /// Gets the maximum duration of a complete operation delegated to the 
underlying transport.
+        /// </summary>
+        public TimeSpan PerCallTimeout
+        {
+            get
+            {
+                if (!(InnerTransport is ITPerCallTransportProvider provider))
+                {
+                    throw new NotSupportedException("The underlying transport 
does not support per-call transports.");
+                }
+                return provider.PerCallTimeout;
+            }
+        }
+
+        /// <summary>
+        /// Gets whether the underlying transport supports per-call transports.
+        /// </summary>
+        public bool SupportsPerCallTransport =>
+            InnerTransport is ITPerCallTransportProvider provider && 
provider.SupportsPerCallTransport;
+
+        /// <summary>
+        /// Creates a framed transport with independent frame buffers around a 
new per-call underlying transport.
+        /// </summary>
+        /// <param name="cancellationToken">Token used to cancel underlying 
transport creation.</param>
+        /// <returns>A new framed transport owned by the caller.</returns>
+        /// <exception cref="NotSupportedException">The underlying transport 
does not support per-call transports.</exception>
+        public async Task<TTransport> 
CreatePerCallTransportAsync(CancellationToken cancellationToken)
+        {
+            if (!(InnerTransport is ITPerCallTransportProvider provider) || 
!provider.SupportsPerCallTransport)
+            {
+                throw new NotSupportedException("The underlying transport does 
not support per-call transports.");
+            }
+
+            var transport = await 
provider.CreatePerCallTransportAsync(cancellationToken);
+            try
+            {
+                return new TFramedTransport(transport);
+            }
+            catch
+            {
+transport?.Dispose();

Review Comment:
   This statement lost the catch block's indentation and does not match the 
surrounding C# formatting, so the repository style check may reject it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to