@@ -14,10 +14,10 @@ namespace Fleck
1414{
1515 public class SocketWrapper : ISocket
1616 {
17-
17+
1818 public const UInt32 KeepAliveInterval = 60000 ;
1919 public const UInt32 RetryInterval = 10000 ;
20-
20+
2121 private readonly Socket _socket ;
2222 private Stream _stream ;
2323 private CancellationTokenSource _tokenSource ;
@@ -166,14 +166,18 @@ public int EndSend(IAsyncResult asyncResult)
166166 }
167167
168168 public Task Send ( byte [ ] buffer , Action callback , Action < Exception > error )
169+ {
170+ return Send ( buffer , 0 , buffer . Length , callback , error ) ;
171+ }
172+ public Task Send ( byte [ ] buffer , int offset , int length , Action callback , Action < Exception > error )
169173 {
170174 if ( _tokenSource . IsCancellationRequested )
171175 return null ;
172176
173177 try
174178 {
175179 Func < AsyncCallback , object , IAsyncResult > begin =
176- ( cb , s ) => _stream . BeginWrite ( buffer , 0 , buffer . Length , cb , s ) ;
180+ ( cb , s ) => _stream . BeginWrite ( buffer , offset , length , cb , s ) ;
177181
178182 Task task = Task . Factory . FromAsync ( begin , _stream . EndWrite , null ) ;
179183 task . ContinueWith ( t => callback ( ) , TaskContinuationOptions . NotOnFaulted )
0 commit comments