Imported Upstream version 5.16.0.144

Former-commit-id: 2b9e8926e7df56dfea2d6991a64c8f5129cfffcb
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-09-05 08:26:42 +00:00
parent 6dab091a3e
commit 47a1b3e592
53 changed files with 201 additions and 108 deletions

View File

@ -405,6 +405,7 @@ namespace System.Net
void CloseSocket ()
{
lock (this) {
Debug ($"WC CLOSE SOCKET: Cnc={ID} NS={networkStream} TLS={monoTlsStream}");
if (networkStream != null) {
try {
networkStream.Dispose ();
@ -412,6 +413,13 @@ namespace System.Net
networkStream = null;
}
if (monoTlsStream != null) {
try {
monoTlsStream.Dispose ();
} catch { }
monoTlsStream = null;
}
if (socket != null) {
try {
socket.Dispose ();