Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.IO;
using System.Net.Sockets;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading;
Expand Down Expand Up @@ -284,6 +285,16 @@ private ElasticsearchResponse<Stream> Execute(RestRequest restRequest, object de
return response;
}
}
catch (SocketException)
{
client.InputProtocol.Transport.Close();
throw;
}
catch (IOException)
{
client.InputProtocol.Transport.Close();
throw;
}
finally
{
//make sure we make the client available again.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ public override void Close()
{
outputBuffer.Close();
}
if (transport != null)
{
transport.Close();
}
}

public override int Read(byte[] buf, int off, int len)
Expand Down