Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Showing with 48 additions and 5 deletions.
  1. +48 −5 GaDotNet.Common/Tracking/GoogleTracking.cs
View
53 GaDotNet.Common/Tracking/GoogleTracking.cs
@@ -18,6 +18,7 @@
*/
using System;
using System.Collections.Generic;
+using System.IO;
using System.Linq;
using System.Net;
using System.Text;
@@ -75,10 +76,52 @@ private static void ShowTrackingImage(HttpContext context)
/// <param name="request">The request.</param>
public static void FireTrackingEvent(TrackingRequest request)
{
-
- //send the request to google
- WebRequest requestForGaGif = WebRequest.Create(request.TrackingGifUri);
- WebResponse response = requestForGaGif.GetResponse();
+ WebRequest requestForGaGif = WebRequest.Create(request.TrackingGifUri);
+ requestForGaGif.BeginGetResponse(r =>
+ {
+ try
+ {
+ var reponse = requestForGaGif.EndGetResponse(r);
+ //ignore response
+ }
+ catch
+ {
+ //suppress error
+ }
+ }, null);
}
- }
+
+
+ private static void ResponseCallback(IAsyncResult result)
+ {
+
+ }
+
+
+
+ }
+
+
+
+
+
+ public class RequestState
+ {
+ public int BufferSize { get; private set; }
+ public StringBuilder ResponseContent { get; set; }
+ public byte[] BufferRead { get; set; }
+ public HttpWebRequest Request { get; set; }
+ public HttpWebResponse Response { get; set; }
+ public Stream ResponseStream { get; set; }
+
+ public RequestState()
+ {
+ BufferSize = 1024;
+ BufferRead = new byte[BufferSize];
+ ResponseContent = new StringBuilder();
+ Request = null;
+ ResponseStream = null;
+ }
+ }
+
}

No commit comments for this range

Something went wrong with that request. Please try again.