0

I have an environmental issue with Measurement Protocol. I coded a server-side call to Google Analytics, sending an event using this as a guide: https://gist.github.com/0liver/11229128

This works in 3 environments, but in the 4th, I get this error:

System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) --- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead) --- End of inner exception stack trace --- at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context) at System.Net.HttpWebRequest.GetRequestStream() at ASP.abc_media_test_tlstest_aspx.GATrackEvent2(String type, String category, String action, String label, String cid, Nullable`1 value) at ASP.abc_media_test_tlstest_aspx.btnSubmit_Click(Object sender, EventArgs e)

I thought maybe it was a WAF issue, but it is not in blocking mode. I've also tried explicitly setting the TLS version. Nothing works. I've run out of ideas. Anyone got any?

TexasT
  • 53
  • 1
  • 7
  • Does this answer your question? [An existing connection was forcibly closed by the remote host](https://stackoverflow.com/questions/2582036/an-existing-connection-was-forcibly-closed-by-the-remote-host) – Linda Lawton - DaImTo Mar 05 '21 at 14:20
  • Unfortunately no. I'm trying to figure out if it's an error while connecting to GA or if my host is closing the connection upon return. I'm thinking it's connecting to GA, though. – TexasT Mar 05 '21 at 19:03

0 Answers0