HttpWebRequest.KeepAlive and remote DataPortal

HttpWebRequest.KeepAlive and remote DataPortal

Old forum URL:

TSF posted on Tuesday, May 12, 2015

WinRT app with CSLA 4.5.601.0 running on devices with WWAN hitting a remote DP in the DMZ (acting as a pass through to an internal app server). We're seeing occasional errors related to connections being closed:

WebException: The underlying connection was closed: An unexpected error occurred on a receive.

SocketException: An existing connection was forcibly closed by the remote host

I see a lot of sites recommending setting HttpWebRequest.KeepAlive = false (default is true). I've not seen anything about this in the CSLA forum. Here's an MSDN post about it

Any thoughts on what the problem might be and whether this is something I should look into for our DP? Again, it is occasional, but occurs often enough that I'd like to figure out what the problem is, if possible.


JonnyBee replied on Tuesday, May 12, 2015


create your own dataportal client implementation and try this to see if it solves the issue. 

TSF replied on Tuesday, May 12, 2015

Is there an example of doing this in the Using e-books? We're already overriding the ProxyFactory, so I assume it would be similar?

public class ProxyFactory : Csla.DataPortalClient.IDataPortalProxyFactory

Copyright (c) Marimer LLC