Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public async ValueTask<RecoveryAwareChannel> CreateNonRecoveringChannelAsync(Can
public override string ToString()
=> $"AutorecoveringConnection({InnerConnection.Id},{Endpoint},{GetHashCode()})";

internal Task CloseFrameHandlerAsync()
internal ValueTask CloseFrameHandlerAsync()
{
return InnerConnection.FrameHandler.CloseAsync(CancellationToken.None);
}
Expand Down
4 changes: 2 additions & 2 deletions projects/RabbitMQ.Client/client/impl/IFrameHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ internal interface IFrameHandler
///<summary>Socket write timeout. System.Threading.Timeout.InfiniteTimeSpan signals "infinity".</summary>
TimeSpan WriteTimeout { set; }

Task CloseAsync(CancellationToken cancellationToken);
ValueTask CloseAsync(CancellationToken cancellationToken);

///<summary>Read a frame from the underlying
///transport. Returns null if the read operation timed out
Expand All @@ -66,7 +66,7 @@ internal interface IFrameHandler
///</summary>
bool TryReadFrame(InboundFrame frame);

Task SendProtocolHeaderAsync(CancellationToken cancellationToken);
ValueTask SendProtocolHeaderAsync(CancellationToken cancellationToken);

ValueTask WriteAsync(RentedMemory frames, CancellationToken cancellationToken);
}
Expand Down
4 changes: 2 additions & 2 deletions projects/RabbitMQ.Client/client/impl/SocketFrameHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public static async Task<SocketFrameHandler> CreateAsync(AmqpTcpEndpoint amqpTcp
return socketFrameHandler;
}

public async Task CloseAsync(CancellationToken cancellationToken)
public async ValueTask CloseAsync(CancellationToken cancellationToken)
{
if (_closed)
{
Expand Down Expand Up @@ -216,7 +216,7 @@ public bool TryReadFrame(InboundFrame frame)
_amqpTcpEndpoint.MaxInboundMessageBodySize, frame);
}

public async Task SendProtocolHeaderAsync(CancellationToken cancellationToken)
public async ValueTask SendProtocolHeaderAsync(CancellationToken cancellationToken)
{
await _pipeWriter.WriteAsync(Amqp091ProtocolHeader, cancellationToken)
.ConfigureAwait(false);
Expand Down
4 changes: 2 additions & 2 deletions projects/Test/Integration/TestConnectionShutdown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@ public async Task TestDisposedWithSocketClosedOutOfBand()
};

var c = (AutorecoveringConnection)_conn;
Task frameHandlerCloseTask = c.CloseFrameHandlerAsync();
ValueTask frameHandlerCloseTask = c.CloseFrameHandlerAsync();

try
{
_conn.Dispose();
await WaitAsync(tcs, WaitSpan, "channel shutdown");
await frameHandlerCloseTask.WaitAsync(WaitSpan);
await frameHandlerCloseTask.AsTask().WaitAsync(WaitSpan);
}
finally
{
Expand Down