File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
src/MySqlConnector/Protocol/Serialization Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . IO ;
3
+ using System . Net . Sockets ;
3
4
using System . Threading ;
4
5
using System . Threading . Tasks ;
5
6
using MySql . Data . MySqlClient ;
@@ -38,7 +39,7 @@ ValueTask<int> DoReadBytesSync(ArraySegment<byte> buffer_)
38
39
}
39
40
catch ( Exception ex )
40
41
{
41
- if ( ex is IOException && RemainingTimeout != Constants . InfiniteTimeout )
42
+ if ( RemainingTimeout != Constants . InfiniteTimeout && ex is IOException ioException && ioException . InnerException is SocketException socketException && socketException . SocketErrorCode == SocketError . TimedOut )
42
43
return ValueTaskExtensions . FromException < int > ( MySqlException . CreateForTimeout ( ex ) ) ;
43
44
return ValueTaskExtensions . FromException < int > ( ex ) ;
44
45
}
You can’t perform that action at this time.
0 commit comments