Skip to content

Commit

Permalink
Cosmetic fixes, remove commented out code
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebakken committed Mar 4, 2020
1 parent ff627be commit b1c16b4
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ private enum RecoveryConnectionState
private RecoveryConnectionState _recoveryLoopState = RecoveryConnectionState.Connected;

private readonly ConcurrentQueue<RecoveryCommand> _recoveryLoopCommandQueue = new ConcurrentQueue<RecoveryCommand>();
readonly SemaphoreSlim _semaphore = new SemaphoreSlim(0);
private readonly SemaphoreSlim _semaphore = new SemaphoreSlim(0);
private readonly CancellationTokenSource _recoveryCancellationToken = new CancellationTokenSource();
private readonly TaskCompletionSource<int> _recoveryLoopComplete = new TaskCompletionSource<int>();

Expand Down
2 changes: 0 additions & 2 deletions projects/client/RabbitMQ.Client/src/client/impl/ModelBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,6 @@ public bool IsOpen
get { return CloseReason == null; }
}



public ulong NextPublishSeqNo { get => _nextPublishSeqNo; }

public ISession Session { get; private set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,36 +253,6 @@ public void WriteFrameSet(IList<OutboundFrame> frames)
{
_writer.Flush();
}
/*
int bufferSize = 0;
for (int i = 0; i < frames.Count; i++)
{
bufferSize += frames[i].GetMinimumBufferSize();
}
using (IMemoryOwner<byte> memory = MemoryPool<byte>.Shared.Rent(bufferSize))
{
int frameBytes = 0;
Memory<byte> slice = memory.Memory.Slice(0, bufferSize);
for (int i = 0; i < frames.Count; i++)
{
OutboundFrame frame = frames[i];
int frameLength = frame.GetMinimumBufferSize();
Memory<byte> frameSlice = slice.Slice(frameBytes, frameLength);
frame.WriteTo(frameSlice);
frameBytes += frame.ByteCount;
}
_socket.Client.Poll(_writeableStateTimeoutMicroSeconds, SelectMode.SelectWrite);
if (MemoryMarshal.TryGetArray(slice.Slice(0, frameBytes), out ArraySegment<byte> segment))
{
Write(segment);
return;
}
throw new InvalidOperationException("Unable to get array segment from memory.");
}
*/
}

private void Write(ArraySegment<byte> bufferSegment, bool flush)
Expand Down
21 changes: 0 additions & 21 deletions projects/client/Unit/src/unit/WireFormattingFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,27 +49,6 @@ namespace RabbitMQ.Client.Unit
{
class WireFormattingFixture
{
public static NetworkBinaryReader Reader(byte[] content)
{
return new NetworkBinaryReader(new MemoryStream(content));
}

public static NetworkBinaryWriter Writer()
{
return new NetworkBinaryWriter(new MemoryStream());
}

public static byte[] Contents(NetworkBinaryWriter w)
{
return ((MemoryStream)w.BaseStream).ToArray();
}

public void Check(NetworkBinaryWriter w, byte[] expected)
{
byte[] actual = Contents(w);
Check(actual, expected);
}

public void Check(byte[] actual, byte[] expected)
{
try
Expand Down

0 comments on commit b1c16b4

Please sign in to comment.