Skip to content

Commit

Permalink
Fixed error catching.
Browse files Browse the repository at this point in the history
  • Loading branch information
DJGosnell committed Aug 24, 2023
1 parent 13c2e42 commit c915f33
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 17 deletions.
8 changes: 1 addition & 7 deletions src/NexNet/Internals/NexusSession.Receiving.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,7 @@ private async ValueTask<ProcessResult> Process(ReadOnlySequence<byte> sequence)

case MessageType.DuplexPipeWrite:
{
var bufferDuplexPipeResult =
await PipeManager.BufferIncomingData(_recMessageHeader.DuplexPipeId, bodySlice);
if (bufferDuplexPipeResult == NexusPipeBufferResult.HighCutoffReached)
{
disconnect = DisconnectReason.NexusPipeHighWaterCutoffReached;
}

await PipeManager.BufferIncomingData(_recMessageHeader.DuplexPipeId, bodySlice);
break;
}

Expand Down
2 changes: 1 addition & 1 deletion src/NexNet/Internals/NexusSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ private async ValueTask DisconnectCore(DisconnectReason reason, bool sendDisconn
{
_pipeOutput!.Complete();
}
catch (ObjectDisposedException)
catch
{
//noop
}
Expand Down
2 changes: 1 addition & 1 deletion src/NexNet/Internals/Pipes/NexusPipeBufferResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ internal enum NexusPipeBufferResult : byte
{
Success,
HighWatermarkReached,
HighCutoffReached,
//HighCutoffReached,
DataIgnored,
}
8 changes: 4 additions & 4 deletions src/NexNet/Messages/DisconnectReason.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ public enum DisconnectReason : byte
/// </summary>
ServerRestarting = MessageType.DisconnectServerRestarting,

/// <summary>
/// The high water cutoff was reached on a duplex pipe.
/// </summary>
NexusPipeHighWaterCutoffReached = MessageType.DisconnectNexusPipeHighWaterCutoffReached,
// <summary>
// The high water cutoff was reached on a duplex pipe.
// </summary>
//NexusPipeHighWaterCutoffReached = MessageType.DisconnectNexusPipeHighWaterCutoffReached,

/// <summary>
/// The socket was closed while attempting to write.
Expand Down
8 changes: 4 additions & 4 deletions src/NexNet/Messages/MessageHeaderType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ public enum MessageType : byte
/// </summary>
DisconnectServerRestarting = 30,

/// <summary>
/// The high water cutoff was reached on a duplex pipe. No body.
/// </summary>
DisconnectNexusPipeHighWaterCutoffReached = 31,
// <summary>
// The high water cutoff was reached on a duplex pipe. No body.
// </summary>
//DisconnectNexusPipeHighWaterCutoffReached = 31,

/// <summary>
/// The socket was closed while attempting to write. No body.
Expand Down

0 comments on commit c915f33

Please sign in to comment.