-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
358 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Pipelines.Extensions.SocketPipe; | ||
using System.IO.Pipelines; | ||
|
||
namespace Shadowsocks.Protocol | ||
{ | ||
internal static class ShadowsocksProtocolConstants | ||
{ | ||
private const int BlockSize = 4096; // 4K | ||
public const int ReceiveBufferSize = 20 * BlockSize; // 80K, must < 85000 LOH | ||
public const int SendBufferSize = 5 * BlockSize; // 20K, must < 85000 LOH | ||
|
||
private const int SegmentPoolSize = 16; | ||
private const int MinimumSegmentSize = BlockSize; | ||
private const int ResumeWriterThreshold = PauseWriterThreshold / 2; | ||
private const int PauseWriterThreshold = MinimumSegmentSize * SegmentPoolSize; | ||
public static readonly PipeOptions DefaultPipeOptions = new( | ||
pauseWriterThreshold: PauseWriterThreshold, | ||
resumeWriterThreshold: ResumeWriterThreshold, | ||
minimumSegmentSize: MinimumSegmentSize); | ||
|
||
public static readonly SocketPipeReaderOptions SocketPipeReaderOptions = new(DefaultPipeOptions, sizeHint: ReceiveBufferSize); | ||
public static readonly SocketPipeWriterOptions SocketPipeWriterOptions = new(DefaultPipeOptions); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
207 changes: 0 additions & 207 deletions
207
Shadowsocks.Protocol/TcpClients/ShadowsocksDuplexPipe.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.