Skip to content

Commit 50a7d6a

Browse files
Merge branch 'stable', upgrade to VS 2015 with Resharper 9.x
2 parents 2dbd1a3 + 06dfe7a commit 50a7d6a

File tree

7 files changed

+70
-44
lines changed

7 files changed

+70
-44
lines changed

RabbitMQDotNetClient.sln

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 2013
4-
VisualStudioVersion = 12.0.31101.0
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.23107.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "projects", "projects", "{068D7DC3-8E6E-4951-B9E3-272C641BF0DE}"
77
EndProject
@@ -25,6 +25,7 @@ EndProject
2525
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RabbitMQ.Client.WinRT", "projects\client\RabbitMQ.Client.WinRT\RabbitMQ.Client.WinRT.csproj", "{61D29F90-5B1C-4748-89FC-9FD2937F09C6}"
2626
ProjectSection(ProjectDependencies) = postProject
2727
{9E8B8DC5-3837-46E9-90D7-8391CC62AB45} = {9E8B8DC5-3837-46E9-90D7-8391CC62AB45}
28+
{71713FDD-D5EC-40B2-A924-76F80AD57E12} = {71713FDD-D5EC-40B2-A924-76F80AD57E12}
2829
EndProjectSection
2930
EndProject
3031
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RabbitMQ.Client.Unit.WinRT", "projects\client\Unit.WinRT\RabbitMQ.Client.Unit.WinRT.csproj", "{897505A9-8373-4F41-8DE8-221BF06D877D}"

RabbitMQDotNetClient.sln.DotSettings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,10 @@
121121
<And>
122122
<Kind Is="Class" />
123123
<HasAttribute Name="NUnit.Framework.TestFixtureAttribute" Inherited="true" />
124+
<<<<<<< HEAD
124125
&lt;HasAttribute Name="NUnit.Framework.TestCaseFixtureAttribute" Inherited="true" /&gt;&#xD;
126+
=======
127+
>>>>>>> stable
125128
&lt;/And&gt;&#xD;
126129
&lt;/TypePattern.Match&gt;&#xD;
127130
&#xD;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">CSharp40</s:String></wpf:ResourceDictionary>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">CSharp40</s:String></wpf:ResourceDictionary>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">CSharp40</s:String></wpf:ResourceDictionary>

projects/client/RabbitMQ.Client/src/client/impl/Connection.cs

Lines changed: 56 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,40 +1025,47 @@ public void StartMainLoop(bool useBackgroundThread)
10251025
public void HeartbeatReadTimerCallback(object state)
10261026
{
10271027
bool shouldTerminate = false;
1028-
if (!m_closed)
1028+
try
10291029
{
1030-
if (!m_heartbeatRead.WaitOne(0))
1030+
if (!m_closed)
10311031
{
1032-
m_missedHeartbeats++;
1032+
if (!m_heartbeatRead.WaitOne(0))
1033+
{
1034+
m_missedHeartbeats++;
1035+
}
1036+
else
1037+
{
1038+
m_missedHeartbeats = 0;
1039+
}
1040+
1041+
// We check against 8 = 2 * 4 because we need to wait for at
1042+
// least two complete heartbeat setting intervals before
1043+
// complaining, and we've set the socket timeout to a quarter
1044+
// of the heartbeat setting in setHeartbeat above.
1045+
if (m_missedHeartbeats > 2 * 4)
1046+
{
1047+
String description = String.Format("Heartbeat missing with heartbeat == {0} seconds", m_heartbeat);
1048+
var eose = new EndOfStreamException(description);
1049+
m_shutdownReport.Add(new ShutdownReportEntry(description, eose));
1050+
HandleMainLoopException(
1051+
new ShutdownEventArgs(ShutdownInitiator.Library, 0, "End of stream", eose));
1052+
shouldTerminate = true;
1053+
}
10331054
}
1034-
else
1055+
1056+
if (shouldTerminate)
10351057
{
1036-
m_missedHeartbeats = 0;
1058+
TerminateMainloop();
1059+
FinishClose();
10371060
}
1038-
1039-
// We check against 8 = 2 * 4 because we need to wait for at
1040-
// least two complete heartbeat setting intervals before
1041-
// complaining, and we've set the socket timeout to a quarter
1042-
// of the heartbeat setting in setHeartbeat above.
1043-
if (m_missedHeartbeats > 2 * 4)
1061+
else
10441062
{
1045-
String description = String.Format("Heartbeat missing with heartbeat == {0} seconds", m_heartbeat);
1046-
var eose = new EndOfStreamException(description);
1047-
m_shutdownReport.Add(new ShutdownReportEntry(description, eose));
1048-
HandleMainLoopException(
1049-
new ShutdownEventArgs(ShutdownInitiator.Library, 0, "End of stream", eose));
1050-
shouldTerminate = true;
1063+
_heartbeatReadTimer.Change(Heartbeat * 1000, Timeout.Infinite);
10511064
}
1052-
}
1053-
1054-
if (shouldTerminate)
1055-
{
1056-
TerminateMainloop();
1057-
FinishClose();
1058-
}
1059-
else
1065+
} catch (ObjectDisposedException ignored)
10601066
{
1061-
_heartbeatReadTimer.Change(Heartbeat * 1000, Timeout.Infinite);
1067+
// timer is already disposed,
1068+
// e.g. due to shutdown
10621069
}
10631070
}
10641071

@@ -1067,26 +1074,33 @@ public void HeartbeatWriteTimerCallback(object state)
10671074
bool shouldTerminate = false;
10681075
try
10691076
{
1070-
if (!m_closed)
1077+
try
10711078
{
1072-
WriteFrame(m_heartbeatFrame);
1073-
m_frameHandler.Flush();
1079+
if (!m_closed)
1080+
{
1081+
WriteFrame(m_heartbeatFrame);
1082+
m_frameHandler.Flush();
1083+
}
1084+
}
1085+
catch (Exception e)
1086+
{
1087+
HandleMainLoopException(new ShutdownEventArgs(
1088+
ShutdownInitiator.Library,
1089+
0,
1090+
"End of stream",
1091+
e));
1092+
shouldTerminate = true;
10741093
}
1075-
}
1076-
catch (Exception e)
1077-
{
1078-
HandleMainLoopException(new ShutdownEventArgs(
1079-
ShutdownInitiator.Library,
1080-
0,
1081-
"End of stream",
1082-
e));
1083-
shouldTerminate = true;
1084-
}
10851094

1086-
if (m_closed || shouldTerminate)
1095+
if (m_closed || shouldTerminate)
1096+
{
1097+
TerminateMainloop();
1098+
FinishClose();
1099+
}
1100+
} catch (ObjectDisposedException ignored)
10871101
{
1088-
TerminateMainloop();
1089-
FinishClose();
1102+
// timer is already disposed,
1103+
// e.g. due to shutdown
10901104
}
10911105
}
10921106

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">CSharp40</s:String></wpf:ResourceDictionary>

0 commit comments

Comments
 (0)