summaryrefslogtreecommitdiff
path: root/Ivy/IvyFilter
diff options
context:
space:
mode:
Diffstat (limited to 'Ivy/IvyFilter')
-rw-r--r--Ivy/IvyFilter/Filter.cs119
-rw-r--r--Ivy/IvyFilter/IvyFilter.csproj61
-rw-r--r--Ivy/IvyFilter/IvyFilter.csproj.vspscc10
-rw-r--r--Ivy/IvyFilter/Properties/AssemblyInfo.cs33
4 files changed, 0 insertions, 223 deletions
diff --git a/Ivy/IvyFilter/Filter.cs b/Ivy/IvyFilter/Filter.cs
deleted file mode 100644
index 03e2435..0000000
--- a/Ivy/IvyFilter/Filter.cs
+++ /dev/null
@@ -1,119 +0,0 @@
-
-using System;
-using IvyBus;
-using System.Threading;
-using Gnu;
-
-namespace IvyFilter
-{
- class Filter
- {
-
- internal Ivy bus;
-
- [STAThread]
- public static void Main(System.String[] args)
- {
- GetOpt opt = new GetOpt(args, "b:n:t:");
- System.String domain = Ivy.GetDomain(null);
- int nb = 10000;
- int t = 1000;
- Arg a;
- while ((a = opt.NextArg() )!= null)
- {
- switch (a.Flag)
- {
-
- case 'b':
- domain = a.Parameter;
- break;
-
- case 't':
- t = int.Parse(a.Parameter);
- break;
-
- case 'n':
- nb = int.Parse(a.Parameter);
- break;
-
- default:
- System.Environment.Exit(0);
- break;
-
- }
- }
- new Filter(domain, nb, t, true);
- }
-
- private int nbmsg;
- private int bounded = 0, unbounded = 0;
- private string[] filter = new string[] { "GetDummy" };
-
- public Filter(string domain, int n, int t, bool f)
- {
- System.Console.Out.WriteLine("trying Filter on " + n + " messages, " + t + " ms delay");
- nbmsg = n;
- bus = new Ivy("Filter", "Filter ready");
- if (f)
- bus.SentMessageFilter.AddRange(filter);
- bus.BindingAdd += new EventHandler<IvyEventArgs>(bus_BindingAdd);
- bus.BindingRemove += new EventHandler<IvyEventArgs>(bus_BindingRemove);
- bus.BindingFilter += new EventHandler<IvyEventArgs>(bus_BindingFilter);
- bus.Start(domain);
- /* attend une seconde ou deux */
- try
- {
- Thread.Sleep(2000);
- }
- catch (System.Threading.ThreadInterruptedException )
- {
- }
- System.Console.Out.WriteLine(bounded + " bounded subscriptions, " + unbounded + " unbounded");
- System.Console.Out.WriteLine(bus.IvyClients.Count + " clients");
- DateTime debut = System.DateTime.Now;
- TimeSpan total = new TimeSpan();
- DateTime debutlocal = System.DateTime.Now;
- DateTime finlocal = System.DateTime.Now;
- for (int i = 0; i < n; i++)
- {
- try
- {
- // System.out.println("sending msg");
- debutlocal = System.DateTime.Now;
- bus.SendMsg("GetDummy message");
- finlocal = System.DateTime.Now;
- total += finlocal - debutlocal;
- Thread.Sleep( t );
- }
- catch (IvyException )
- {
- System.Environment.Exit(-1);
- }
- catch (ThreadInterruptedException )
- {
- }
- }
- System.Console.Out.WriteLine(((f) ? "[filtered] " : "[non filtered] ") + total.TotalMilliseconds + "ms elapsed, " + (finlocal - debut).TotalMilliseconds + " ms total out of " + n * t);
- bus.Stop();
- if (f == true)
- new Filter(domain, n, t, false); // relance le même test sans filtre
- System.Console.ReadLine();
- }
-
- void bus_BindingFilter(object sender, IvyEventArgs e)
- {
- unbounded++;
- }
-
- void bus_BindingRemove(object sender, IvyEventArgs e)
- {
- bounded--;
- }
-
- void bus_BindingAdd(object sender, IvyEventArgs e)
- {
- bounded++;
- }
-
- }
-} \ No newline at end of file
diff --git a/Ivy/IvyFilter/IvyFilter.csproj b/Ivy/IvyFilter/IvyFilter.csproj
deleted file mode 100644
index 1d3c263..0000000
--- a/Ivy/IvyFilter/IvyFilter.csproj
+++ /dev/null
@@ -1,61 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{151B7DDB-279B-4E1E-903B-E09B079FA0A5}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>IvyFilter</RootNamespace>
- <AssemblyName>IvyFilter</AssemblyName>
- <SccProjectName>SAK</SccProjectName>
- <SccLocalPath>SAK</SccLocalPath>
- <SccAuxPath>SAK</SccAuxPath>
- <SccProvider>SAK</SccProvider>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Filter.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\getopt\getopt.csproj">
- <Project>{228B5F0B-31AE-488F-A916-B7CBB269D25F}</Project>
- <Name>getopt</Name>
- </ProjectReference>
- <ProjectReference Include="..\Ivy\Ivy.csproj">
- <Project>{F2F03CF7-0087-4EDB-AD15-80C9E8DA2617}</Project>
- <Name>Ivy</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.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project> \ No newline at end of file
diff --git a/Ivy/IvyFilter/IvyFilter.csproj.vspscc b/Ivy/IvyFilter/IvyFilter.csproj.vspscc
deleted file mode 100644
index 353c834..0000000
--- a/Ivy/IvyFilter/IvyFilter.csproj.vspscc
+++ /dev/null
@@ -1,10 +0,0 @@
-""
-{
-"FILE_VERSION" = "9237"
-"ENLISTMENT_CHOICE" = "NEVER"
-"PROJECT_FILE_RELATIVE_PATH" = "relative:IvyFilter"
-"NUMBER_OF_EXCLUDED_FILES" = "0"
-"ORIGINAL_PROJECT_FILE_PATH" = ""
-"NUMBER_OF_NESTED_PROJECTS" = "0"
-"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
-}
diff --git a/Ivy/IvyFilter/Properties/AssemblyInfo.cs b/Ivy/IvyFilter/Properties/AssemblyInfo.cs
deleted file mode 100644
index 723881f..0000000
--- a/Ivy/IvyFilter/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("IvyFilter")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("DTI/SDER")]
-[assembly: AssemblyProduct("IvyFilter")]
-[assembly: AssemblyCopyright("Copyright © DTI/SDER 2006")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("7d041760-bc83-40d7-a534-b90993c58737")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]