Permalink
Browse files

Version 0.1

just GET and mostly for proof of concept benchmarking
  • Loading branch information...
0 parents commit 4a60174c3d5d968a3d53767455088ebbcf221115 @Bobris committed Jun 5, 2013
Showing with 9,502 additions and 0 deletions.
  1. +22 −0 .gitattributes
  2. +19 −0 .gitignore
  3. +22 −0 BenchmarkClients/COPYING.txt
  4. BIN BenchmarkClients/CygWin1.dll
  5. +31 −0 BenchmarkClients/PACKINFO.txt
  6. BIN BenchmarkClients/WeigHTTP.exe
  7. BIN BenchmarkClients/ab.exe
  8. +1 −0 BenchmarkClients/test.bat
  9. +1 −0 BenchmarkClients/testk.bat
  10. +6 −0 FluxServer/App.config
  11. +148 −0 FluxServer/BufferStream.cs
  12. +22 −0 FluxServer/DictionaryExtensions.cs
  13. +22 −0 FluxServer/DisposableEx.cs
  14. +80 −0 FluxServer/FluxServer.csproj
  15. +72 −0 FluxServer/HeaderParser.cs
  16. +289 −0 FluxServer/Instance.cs
  17. +43 −0 FluxServer/InvalidRequestException.cs
  18. +18 −0 FluxServer/Program.cs
  19. +36 −0 FluxServer/Properties/AssemblyInfo.cs
  20. +31 −0 FluxServer/RequestLine.cs
  21. +46 −0 FluxServer/RequestLineParser.cs
  22. +92 −0 FluxServer/Server.cs
  23. +13 −0 FluxServer/StreamExtensions.cs
  24. +14 −0 FluxServer/TaskHelper.cs
  25. +5 −0 FluxServer/packages.config
  26. +6 −0 HttpListener/App.config
  27. +68 −0 HttpListener/HttpListener.csproj
  28. +32 −0 HttpListener/Program.cs
  29. +36 −0 HttpListener/Properties/AssemblyInfo.cs
  30. +1 −0 HttpListener/enable.bat
  31. +4 −0 HttpListener/packages.config
  32. +6 −0 MonoHttpListener/App.config
  33. +79 −0 MonoHttpListener/Constants.cs
  34. +39 −0 MonoHttpListener/DictionaryExtensions.cs
  35. +96 −0 MonoHttpListener/MonoHttpListener.csproj
  36. +282 −0 MonoHttpListener/OwinHttpListener.cs
  37. +32 −0 MonoHttpListener/Program.cs
  38. +36 −0 MonoHttpListener/Properties/AssemblyInfo.cs
  39. +321 −0 MonoHttpListener/RequestProcessing/CallEnvironment.Generated.tt
  40. +1,695 −0 MonoHttpListener/RequestProcessing/CallEnvironment.Generated1.cs
  41. +162 −0 MonoHttpListener/RequestProcessing/CallEnvironment.cs
  42. +389 −0 MonoHttpListener/RequestProcessing/ExceptionFilterStream.cs
  43. +198 −0 MonoHttpListener/RequestProcessing/HeadersDictionaryBase.cs
  44. +43 −0 MonoHttpListener/RequestProcessing/HttpListenerStreamWrapper.cs
  45. +112 −0 MonoHttpListener/RequestProcessing/NilDictionary.cs
  46. +168 −0 MonoHttpListener/RequestProcessing/OwinHttpListenerContext.cs
  47. +156 −0 MonoHttpListener/RequestProcessing/OwinHttpListenerRequest.cs
  48. +221 −0 MonoHttpListener/RequestProcessing/OwinHttpListenerResponse.cs
  49. +88 −0 MonoHttpListener/RequestProcessing/RequestHeadersDictionary.cs
  50. +152 −0 MonoHttpListener/RequestProcessing/ResponseHeadersDictionary.cs
  51. +4 −0 MonoHttpListener/packages.config
  52. +6 −0 Node/h.js
  53. +21 −0 Node/hc.js
  54. +19 −0 Node/node_modules/httpsys/.npmignore
  55. +13 −0 Node/node_modules/httpsys/LICENSE.txt
  56. +42 −0 Node/node_modules/httpsys/README.md
  57. +10 −0 Node/node_modules/httpsys/binding.gyp
  58. +5 −0 Node/node_modules/httpsys/checkplatform.js
  59. +588 −0 Node/node_modules/httpsys/lib/httpsys.js
  60. BIN Node/node_modules/httpsys/lib/ia32/httpsys.node
  61. BIN Node/node_modules/httpsys/lib/x64/httpsys.node
  62. +49 −0 Node/node_modules/httpsys/package.json
  63. +1,226 −0 Node/node_modules/httpsys/src/httpsys.cc
  64. +105 −0 Node/node_modules/httpsys/src/httpsys.h
  65. +38 −0 Node/node_modules/httpsys/test/performance/httpsys-secure.ubr
  66. +36 −0 Node/node_modules/httpsys/test/performance/httpsys.ubr
  67. +1 −0 Node/node_modules/httpsys/test/performance/run.bat
  68. +69 −0 Node/node_modules/httpsys/test/performance/server.js
  69. BIN Node/node_modules/httpsys/test/performance/x509.pfx
  70. +18 −0 Node/node_modules/httpsys/test/performance/x509.txt
  71. +6 −0 Node/s.js
  72. +22 −0 Node/sc.js
  73. +57 −0 Nowin.sln
  74. +6 −0 NowinSample/App.config
  75. +68 −0 NowinSample/NowinSample.csproj
  76. +19 −0 NowinSample/Program.cs
  77. +35 −0 NowinSample/Properties/AssemblyInfo.cs
  78. +681 −0 NowinWebServer/ConnectionInfo.cs
  79. +57 −0 NowinWebServer/NowinWebServer.csproj
  80. +23 −0 NowinWebServer/OwinKeys.cs
  81. +35 −0 NowinWebServer/Properties/AssemblyInfo.cs
  82. +82 −0 NowinWebServer/RequestStream.cs
  83. +147 −0 NowinWebServer/ResponseStream.cs
  84. +108 −0 NowinWebServer/Server.cs
  85. +36 −0 SampleOwinApp/Properties/AssemblyInfo.cs
  86. +23 −0 SampleOwinApp/Sample.cs
  87. +59 −0 SampleOwinApp/SampleOwinApp.csproj
  88. +4 −0 SampleOwinApp/packages.config
  89. BIN packages/Fix.0.3.3.13/Fix.0.3.3.13.nupkg
  90. +16 −0 packages/Fix.0.3.3.13/Fix.0.3.3.13.nuspec
  91. BIN packages/Fix.0.3.3.13/lib/net40/Fix.dll
  92. BIN packages/Flux.0.3.4.52245/Flux.0.3.4.52245.nupkg
  93. +22 −0 packages/Flux.0.3.4.52245/Flux.0.3.4.52245.nuspec
  94. BIN packages/Flux.0.3.4.52245/lib/net40/Flux.exe
  95. BIN ...ges/Microsoft.Owin.Host.HttpListener.0.21.0-pre/Microsoft.Owin.Host.HttpListener.0.21.0-pre.nupkg
  96. +18 −0 ...es/Microsoft.Owin.Host.HttpListener.0.21.0-pre/Microsoft.Owin.Host.HttpListener.0.21.0-pre.nuspec
  97. BIN packages/Microsoft.Owin.Host.HttpListener.0.21.0-pre/lib/net40/Microsoft.Owin.Host.HttpListener.dll
  98. +112 −0 packages/Microsoft.Owin.Host.HttpListener.0.21.0-pre/lib/net40/Microsoft.Owin.Host.HttpListener.xml
  99. BIN packages/Microsoft.Owin.Host.HttpListener.0.21.0-pre/lib/net45/Microsoft.Owin.Host.HttpListener.dll
  100. +117 −0 packages/Microsoft.Owin.Host.HttpListener.0.21.0-pre/lib/net45/Microsoft.Owin.Host.HttpListener.xml
  101. BIN packages/Mono.Net.HttpListener.1.0.0.0/Mono.Net.HttpListener.1.0.0.0.nupkg
  102. +19 −0 packages/Mono.Net.HttpListener.1.0.0.0/Mono.Net.HttpListener.1.0.0.0.nuspec
  103. BIN packages/Mono.Net.HttpListener.1.0.0.0/lib/net40/Mono.Net.HttpListener.dll
  104. BIN packages/Mono.Net.HttpListener.1.0.0.0/lib/net40/Mono.Security.dll
  105. BIN packages/Mono.Net.HttpListener.1.0.0.0/lib/net45/Mono.Net.HttpListener.dll
  106. BIN packages/Mono.Net.HttpListener.1.0.0.0/lib/net45/Mono.Security.dll
  107. BIN packages/Owin.Types.0.8.5/Owin.Types.0.8.5.nupkg
  108. +18 −0 packages/Owin.Types.0.8.5/Owin.Types.0.8.5.nuspec
  109. BIN packages/Owin.Types.0.8.5/lib/net40/Owin.Types.dll
  110. +7 −0 packages/repositories.config
@@ -0,0 +1,22 @@
+# Auto detect text files and perform LF normalization
+* text=auto
+
+# Custom for Visual Studio
+*.cs diff=csharp
+*.sln merge=union
+*.csproj merge=union
+*.vbproj merge=union
+*.fsproj merge=union
+*.dbproj merge=union
+
+# Standard to msysgit
+*.doc diff=astextplain
+*.DOC diff=astextplain
+*.docx diff=astextplain
+*.DOCX diff=astextplain
+*.dot diff=astextplain
+*.DOT diff=astextplain
+*.pdf diff=astextplain
+*.PDF diff=astextplain
+*.rtf diff=astextplain
+*.RTF diff=astextplain
@@ -0,0 +1,19 @@
+*~
+bin
+obj
+*.user
+*.suo
+*.bak
+*.sln.cache
+_ReSharper*
+Reports
+*/build
+TestResults
+*.pidb
+*.usertasks
+*.userprefs
+*.origtest-resultsdist
+*.ncrunchsolution
+*.ncrunchproject
+*.crunchsolution.cache
+*.DotSettings
@@ -0,0 +1,22 @@
+
+The MIT License
+
+Copyright (c) 2009-2011 Thomas Porzelt
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
Binary file not shown.
@@ -0,0 +1,31 @@
+/***#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-#***\
+\ W | PRE-COMPILED PACKS FOR WLMP PROJECT | W /
+/ L | - - - - - - - - - - - - - - - - - - - - - | L \
+\ M | Copyright (C) 2006 - 2012 | M /
+/ P | WLMP Project - http://wlmp-project.net/ | P \
+\***#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-#***/
+
+// -- PACKAGE: WeigHTTP-0.3-Win32 -- //
+
+===================
+PACKAGE INFORMATION
+===================
+
+Package Name: WeigHTTP (Win32)
+Package Type: Binary
+Package Version: 0.3
+Revision: 1bdbe400
+Release Date: 2012-01-10
+
+Status: Stable Release
+Language: English
+Compilation Platform: i686-pc-cygwin (GCC-4.5.3)
+
+Author: Thomas Porzelt
+License: MIT License
+
+Operating System: Microsoft Windows 2000 / XP / 2003 / Vista / 2008 / 7
+
+Online documentation: http://redmine.lighttpd.net/projects/weighttp/wiki
+
+Notice: This version is built for WLMP Webserver Package.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
+WeigHTTP.exe -c 200 -t 4 -n 100000 http://localhost:8888/
@@ -0,0 +1 @@
+WeigHTTP.exe -c 200 -t 4 -n 400000 -k http://localhost:8888/
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+ <startup>
+ <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
+ </startup>
+</configuration>
@@ -0,0 +1,148 @@
+namespace Flux
+{
+ using System;
+ using System.IO;
+ using System.Threading;
+
+ internal sealed class BufferStream : Stream
+ {
+ private MemoryStream _memoryStream;
+
+ internal Stream InternalStream
+ {
+ get { return _memoryStream
+ ??
+ Interlocked.CompareExchange(ref _memoryStream, new MemoryStream(), null)
+ ??
+ _memoryStream; }
+ }
+
+ public void Reset()
+ {
+ if (_memoryStream == null) return;
+ var buffer = _memoryStream.GetBuffer();
+ Array.Clear(buffer, 0, buffer.Length);
+ _memoryStream.Position = 0;
+ _memoryStream.SetLength(0);
+ }
+
+ public override void Flush()
+ {
+ InternalStream.Flush();
+ }
+
+ public override void Write(byte[] buffer, int offset, int count)
+ {
+ InternalStream.Write(buffer, offset, count);
+ }
+
+ public override long Length
+ {
+ get
+ {
+ return _memoryStream == null ? 0 : _memoryStream.Length;
+ }
+ }
+
+ public override long Position
+ {
+ get
+ {
+ return _memoryStream == null ? 0 : _memoryStream.Position;
+ }
+ set { InternalStream.Position = value; }
+ }
+
+ public override void SetLength(long value)
+ {
+ InternalStream.SetLength(value);
+ }
+
+ public override int Read(byte[] buffer, int offset, int count)
+ {
+ return InternalStream.Read(buffer, offset, count);
+ }
+
+ public override bool CanRead
+ {
+ get { return InternalStream.CanRead; }
+ }
+
+ public override bool CanSeek
+ {
+ get { return InternalStream.CanSeek; }
+ }
+
+ public override bool CanWrite
+ {
+ get { return InternalStream.CanWrite; }
+ }
+
+ public override long Seek(long offset, SeekOrigin origin)
+ {
+ return InternalStream.Seek(offset, origin);
+ }
+
+ public override void Close()
+ {
+ }
+ protected override void Dispose(bool disposing)
+ {
+ }
+ public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
+ {
+ return InternalStream.BeginRead(buffer, offset, count, callback, state);
+ }
+
+ public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
+ {
+ return InternalStream.BeginWrite(buffer, offset, count, callback, state);
+ }
+
+ public override int EndRead(IAsyncResult asyncResult)
+ {
+ return InternalStream.EndRead(asyncResult);
+ }
+
+ public override void EndWrite(IAsyncResult asyncResult)
+ {
+ InternalStream.EndWrite(asyncResult);
+ }
+
+ public override int ReadByte()
+ {
+ return InternalStream.ReadByte();
+ }
+
+ public override int ReadTimeout
+ {
+ get
+ {
+ return InternalStream.ReadTimeout;
+ }
+ set
+ {
+ InternalStream.ReadTimeout = value;
+ }
+ }
+
+ internal void ForceDispose()
+ {
+ if (_memoryStream != null)
+ {
+ _memoryStream.Dispose();
+ }
+ }
+
+ internal bool TryGetBuffer(out byte[] buffer)
+ {
+ if (_memoryStream != null)
+ {
+ buffer = _memoryStream.GetBuffer();
+ return true;
+ }
+ buffer = null;
+ return false;
+ }
+ }
+}
@@ -0,0 +1,22 @@
+namespace Flux
+{
+ using System.Collections.Generic;
+
+ internal static class DictionaryExtensions
+ {
+ public static T GetValueOrDefault<T>(this IDictionary<string, object> dictionary, string key)
+ {
+ return GetValueOrDefault(dictionary, key, default(T));
+ }
+
+ public static T GetValueOrDefault<T>(this IDictionary<string, object> dictionary, string key, T defaultValue)
+ {
+ object value;
+ if (dictionary.TryGetValue(key, out value))
+ {
+ return (T) value;
+ }
+ return defaultValue;
+ }
+ }
+}
@@ -0,0 +1,22 @@
+namespace Flux
+{
+ using System;
+
+ internal static class DisposableEx
+ {
+ public static bool TryDispose(this IDisposable disposable)
+ {
+ if (disposable == null) return false;
+
+ try
+ {
+ disposable.Dispose();
+ return true;
+ }
+ catch (Exception)
+ {
+ return false;
+ }
+ }
+ }
+}
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{787958AE-2D58-43EE-A611-112CB280DA8F}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>FluxServer</RootNamespace>
+ <AssemblyName>FluxServer</AssemblyName>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <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' ">
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Fix, Version=0.3.3.13, Culture=neutral, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\packages\Fix.0.3.3.13\lib\net40\Fix.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="BufferStream.cs" />
+ <Compile Include="DictionaryExtensions.cs" />
+ <Compile Include="DisposableEx.cs" />
+ <Compile Include="HeaderParser.cs" />
+ <Compile Include="Instance.cs" />
+ <Compile Include="InvalidRequestException.cs" />
+ <Compile Include="Program.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="RequestLine.cs" />
+ <Compile Include="RequestLineParser.cs" />
+ <Compile Include="Server.cs" />
+ <Compile Include="StreamExtensions.cs" />
+ <Compile Include="TaskHelper.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="App.config" />
+ <None Include="packages.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\SampleOwinApp\SampleOwinApp.csproj">
+ <Project>{5897faee-8b03-405a-9661-099cbfb2a162}</Project>
+ <Name>SampleOwinApp</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\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>
Oops, something went wrong.

0 comments on commit 4a60174

Please sign in to comment.