File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -140,19 +140,15 @@ public void Start()
140
140
continue ;
141
141
}
142
142
#elif FEATURE_STREAM_APM
143
- var asyncResult = _input . BeginRead ( buffer , 0 , buffer . Length , delegate ( IAsyncResult result )
144
- {
145
- // If input stream is closed and disposed already dont finish reading the stream
146
- if ( _input == null )
147
- return ;
148
-
149
- var read = _input . EndRead ( result ) ;
150
- if ( read > 0 )
143
+ var asyncResult = _input . BeginRead ( buffer , 0 , buffer . Length , result =>
151
144
{
152
- _channel . SendData ( buffer , 0 , read ) ;
153
- }
145
+ // If input stream is closed and disposed already don't finish reading the stream
146
+ if ( _input == null )
147
+ return ;
154
148
155
- } , null ) ;
149
+ var read = _input . EndRead ( result ) ;
150
+ _channel . SendData ( buffer , 0 , read ) ;
151
+ } , null ) ;
156
152
157
153
WaitHandle . WaitAny ( new [ ] { asyncResult . AsyncWaitHandle , _channelClosedWaitHandle } ) ;
158
154
You can’t perform that action at this time.
0 commit comments