mfenniak/rethinkdb-net — pull request #130 by mfenniak (2013-09-17 19:39:54+00:00)
Title: Unable to Connect to RethinkDB from ASP.NET Web Forms Application

I've created a sample ASP.NET Web Forms application in attempting to reproduce the issue reported as issue #129. I was able to reproduce an unidentified hang in connecting to any RethinkDB database when hosted under a ASP.NET, under both the Visual Studio Development Server and IIS Express.

To produce this issue, first I created a new blank ASP.NET Web Forms project. Then I populated the web.config as follows:

```

```

Then I created a Default.aspx page:

```
... snip boilerplate ...

... snip boilerplate ...
```

With this code-behind:

```
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
var connection = ConfigConnectionFactory.Instance.Get("testCluster");
connection.Connect();

bulletList.DataSource = connection.Run(Query.DbList());
bulletList.DataBind();
}
}
```

When loading the above Default.aspx page under a debugger and stepping into the Connect method, the connect processing seems to "disappear" around this line in DoTryConnect (Connection.cs:156):

```
await taskFactory.FromAsync(
(asyncCallback, asyncState) => socket.BeginConnect(endpoint.Address, endpoint.Port, asyncCallback, asyncState),
ar => socket.EndConnect(ar),
null
);
```

The DoTryConnect async method never continues to execute.