Skip to content

Commit

Permalink
Fixes #35 - sequential now gets incremented so that the queueSequenti…
Browse files Browse the repository at this point in the history
…al method now does not always use the first NotificationConnection instance
  • Loading branch information
Redth committed Mar 6, 2012
1 parent a351f95 commit 6f4264a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
4 changes: 2 additions & 2 deletions JdSoft.Apple.Apns.Notifications/NotificationService.cs
Expand Up @@ -468,11 +468,11 @@ void newCon_Connecting(object sender)

private bool queueSequential(Notification notification)
{
if (notificationConnections.Count <= sequential && sequential > 0)
if (sequential > notificationConnections.Count - 1)
sequential = 0;

if (notificationConnections[sequential] != null)
return notificationConnections[sequential].QueueNotification(notification);
return notificationConnections[sequential++].QueueNotification(notification);

return false;
}
Expand Down
22 changes: 22 additions & 0 deletions JdSoft.Apple.Apns.sln
Expand Up @@ -15,7 +15,21 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JdSoft.Apple.Apns.Notificat
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JdSoft.Apple.Apns.Notifications.JsonTest", "JdSoft.Apple.Apns.Notifications.JsonTest\JdSoft.Apple.Apns.Notifications.JsonTest.csproj", "{1A7ACE5F-EF8A-4C5E-87B5-CBBFA432DFE4}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{BA4010CC-021A-4968-9867-145F7CB17D8E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.Notifications", "Tests.Notifications\Tests.Notifications.csproj", "{0AD797AA-2793-4E8A-A481-60B89DE36680}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{85551CB3-03EB-4A50-8104-9810A38B860D}"
ProjectSection(SolutionItems) = preProject
JdSoft.Apple.Apns.vsmdi = JdSoft.Apple.Apns.vsmdi
Local.testsettings = Local.testsettings
TraceAndTestImpact.testsettings = TraceAndTestImpact.testsettings
EndProjectSection
EndProject
Global
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = JdSoft.Apple.Apns.vsmdi
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
Expand Down Expand Up @@ -49,10 +63,18 @@ Global
{1A7ACE5F-EF8A-4C5E-87B5-CBBFA432DFE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1A7ACE5F-EF8A-4C5E-87B5-CBBFA432DFE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1A7ACE5F-EF8A-4C5E-87B5-CBBFA432DFE4}.Release|Any CPU.Build.0 = Release|Any CPU
{0AD797AA-2793-4E8A-A481-60B89DE36680}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0AD797AA-2793-4E8A-A481-60B89DE36680}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0AD797AA-2793-4E8A-A481-60B89DE36680}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0AD797AA-2793-4E8A-A481-60B89DE36680}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{0AD797AA-2793-4E8A-A481-60B89DE36680} = {BA4010CC-021A-4968-9867-145F7CB17D8E}
{85551CB3-03EB-4A50-8104-9810A38B860D} = {BA4010CC-021A-4968-9867-145F7CB17D8E}
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = JdSoft.Apple.Apns.Notifications\JdSoft.Apple.Apns.Notifications.csproj
version = 0.1
Expand Down
10 changes: 9 additions & 1 deletion Tests.Notifications/Tests.Notifications.csproj
Expand Up @@ -6,7 +6,7 @@
<ProductVersion>
</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>915e6cb7-569f-42a7-be6c-baa27bbd88e5</ProjectGuid>
<ProjectGuid>{0AD797AA-2793-4E8A-A481-60B89DE36680}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Tests.Notifications</RootNamespace>
Expand All @@ -33,6 +33,7 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
Expand All @@ -45,6 +46,13 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UnitTest1.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\JdSoft.Apple.Apns.Notifications\JdSoft.Apple.Apns.Notifications.csproj">
<Project>{4CFB9AA8-55F8-46DC-B7BD-9E18B9939110}</Project>
<Name>JdSoft.Apple.Apns.Notifications</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down

0 comments on commit 6f4264a

Please sign in to comment.