Skip to content

Commit 731f8d0

Browse files
committed
2 parents b07746e + 414ec9c commit 731f8d0

File tree

6 files changed

+9
-6
lines changed

6 files changed

+9
-6
lines changed

SLSSDK/Client.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
using System.Diagnostics;
1818
using System.IO;
1919
using System.Text;
20-
using Aliyun.Api.SLS.Response;
2120

2221
namespace Aliyun.Api.LOG
2322
{

SLSSDK/Common/Communication/ServiceClientImpl.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,16 +280,18 @@ private static void SetRequestContent(HttpWebRequest webRequest,
280280
webRequest.KeepAlive = false;
281281
webRequest.ServicePoint.ConnectionLeaseTimeout = 5000;
282282
webRequest.ServicePoint.MaxIdleTime = 5000;
283-
//webRequest.ReadWriteTimeout = 100000000;
284283
webRequest.ServicePoint.ConnectionLimit = 1000;
285284
webRequest.ServicePoint.Expect100Continue = false;
286-
//webRequest.ServicePoint.CloseConnectionGroup();
285+
// Generate GUID for connection group name, force close it when request is done.
286+
webRequest.ConnectionGroupName = Guid.NewGuid().ToString();
287+
287288
using (var requestStream = webRequest.GetRequestStream())
288289
{
289290
data.WriteTo(requestStream, webRequest.ContentLength);
290291
data.Seek(0, SeekOrigin.Begin);
291292
requestStream.Flush();
292293
requestStream.Close();
294+
293295
}
294296
data.Close();
295297
data.Dispose();

SLSSDK/Common/Communication/ServiceRequest.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ protected virtual void Dispose(bool disposing)
150150
}
151151
if (HttpRequest != null)
152152
{
153+
// force close connection group
154+
//Console.WriteLine(HttpRequest.ConnectionGroupName + "[]" + HttpRequest.ConnectionGroupName.Length.ToString() + "[]" + HttpRequest.ServicePoint.CurrentConnections.ToString());
155+
HttpRequest.ServicePoint.CloseConnectionGroup(HttpRequest.ConnectionGroupName);
153156
HttpRequest.Abort();
154157
HttpRequest = null;
155158
}

SLSSDK/Response/BatchGetLogsResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
using System.Linq;
88
using System.Text;
99

10-
namespace Aliyun.Api.SLS.Response
10+
namespace Aliyun.Api.LOG.Response
1111
{
1212
public class BatchGetLogsResponse : LogResponse
1313
{

SLSSDK/Response/ListShardsResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System.Linq;
66
using System.Text;
77

8-
namespace Aliyun.Api.SLS.Response
8+
namespace Aliyun.Api.LOG.Response
99
{
1010
public class ListShardsResponse: LogResponse
1111
{

SLSSDK/sample/LoghubSample.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using Aliyun.Api.LOG.Request;
44
using Aliyun.Api.LOG.Response;
55
using Aliyun.Api.LOG.Utilities;
6-
using Aliyun.Api.SLS.Response;
76
using System;
87
using System.Collections.Generic;
98
using System.IO;

0 commit comments

Comments
 (0)