File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
src/EventStore.Transport.Tcp Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 11
11
12
12
namespace EventStore . Transport . Tcp {
13
13
public class TcpConnection : TcpConnectionBase , ITcpConnection {
14
- internal const int MaxSendPacketSize = 64 * 1024 ;
14
+ internal const int MaxSendPacketSize = 65535 /*Max IP packet size*/ - 20 /*IP packet header size*/ - 32 /*TCP min header size*/ ;
15
15
16
16
internal static readonly BufferManager BufferManager =
17
17
new BufferManager ( TcpConfiguration . BufferChunksCount , TcpConfiguration . SocketBufferSize ) ;
@@ -151,7 +151,7 @@ private void TrySend() {
151
151
try {
152
152
do {
153
153
lock ( _sendLock ) {
154
- if ( _isSending || _sendQueue . IsEmpty || _sendSocketArgs == null ) return ;
154
+ if ( _isSending || ( _sendQueue . IsEmpty && _memoryStreamOffset >= _memoryStream . Length ) || _sendSocketArgs == null ) return ;
155
155
if ( TcpConnectionMonitor . Default . IsSendBlocked ( ) ) return ;
156
156
_isSending = true ;
157
157
}
Original file line number Diff line number Diff line change @@ -345,7 +345,7 @@ private void TrySend() {
345
345
try {
346
346
do {
347
347
lock ( _streamLock ) {
348
- if ( _isSending || _sendQueue . IsEmpty || _sslStream == null || ! _isAuthenticated ) return ;
348
+ if ( _isSending || ( _sendQueue . IsEmpty && _memoryStreamOffset >= _memoryStream . Length ) || _sslStream == null || ! _isAuthenticated ) return ;
349
349
if ( TcpConnectionMonitor . Default . IsSendBlocked ( ) ) return ;
350
350
_isSending = true ;
351
351
}
You can’t perform that action at this time.
0 commit comments