Skip to content

Commit

Permalink
Merge pull request #274 from brad-jones/master
Browse files Browse the repository at this point in the history
Fixes #272
  • Loading branch information
nosami committed Jul 22, 2015
2 parents 73b47c5 + 3bf3018 commit 6f4a617
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/OmniSharp/Dnx/DesignTimeHostManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void Start(string hostId, Action<int> onConnected)
using (var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
{
var t1 = DateTime.UtcNow;
var dthTimeout = TimeSpan.FromSeconds(4);
var dthTimeout = TimeSpan.FromSeconds(10);
while (!socket.Connected && DateTime.UtcNow - t1 < dthTimeout)
{
Thread.Sleep(500);
Expand All @@ -76,6 +76,13 @@ public void Start(string hostId, Action<int> onConnected)
// this happens when the DTH isn't listening yet
}
}

if (!socket.Connected)
{
// reached timeout
_logger.LogError("Failed to launch DesignTimeHost in a timely fashion.");
return;
}
}

if (_designTimeHostProcess.HasExited)
Expand All @@ -98,7 +105,7 @@ public void Start(string hostId, Action<int> onConnected)
onConnected(port);
}
}

public void Stop()
{
lock (_processLock)
Expand Down

0 comments on commit 6f4a617

Please sign in to comment.