Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

Commit

Permalink
Adjustment, cleanup, tweaking PGM
Browse files Browse the repository at this point in the history
  • Loading branch information
phatboyg committed Feb 17, 2011
1 parent 48ee61f commit 927e876
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Stact.Benchmarks/Stact.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<OutputPath>..\..\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand Down
27 changes: 21 additions & 6 deletions src/Stact.ServerFramework/Pgm/Internal/PgmSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,42 @@ public PgmSocket()
{
}

public bool EnableHighSpeed()
{
return EnableHighSpeed(this);
}

public bool SetPgmOption(int option, byte[] value)
{
return SetPgmOption(this, option, value);
}

public bool SetPgmOption(int option, uint value)
{
return SetPgmOption(this, option, value);
}

public static bool SetPgmOption(Socket socket, int option, byte[] value)
{
try
{
SetSocketOption(PgmLevel, (SocketOptionName)option, value);
socket.SetSocketOption(PgmLevel, (SocketOptionName)option, value);
return true;
}
catch (Exception ex)
catch (Exception)
{
return false;
}
}

public bool SetPgmOption(int option, uint value)
public static bool SetPgmOption(Socket socket, int option, uint value)
{
return SetPgmOption(option, BitConverter.GetBytes(value));
return SetPgmOption(socket, option, BitConverter.GetBytes(value));
}

public bool EnableHighSpeed()
public static bool EnableHighSpeed(Socket socket)
{
return SetPgmOption(PgmSocketOptions.HighSpeedIntranetOpt, 1);
return SetPgmOption(socket, PgmSocketOptions.HighSpeedIntranetOpt, 1);
}
}
}
2 changes: 1 addition & 1 deletion src/Stact.ServerFramework/Pgm/Internal/PgmWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace Stact.ServerFramework.Internal
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using Magnum.Extensions;


Expand Down Expand Up @@ -72,7 +73,6 @@ public void Start()
IPEndPoint endpoint = _uri.ResolveHostName().Single();
IPEndPoint bindEndpoint = GetBindEndpoint();


Trace.WriteLine("Binding producer to address: " + endpoint);
_socket.Bind(bindEndpoint);

Expand Down
1 change: 0 additions & 1 deletion src/Stact.Specs/Stact.Specs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@
<Compile Include="Actors\PingPongDemo\PongActor.cs" />
<Compile Include="Actors\PingPong_Example.cs" />
<Compile Include="Channels\Convention_Specs.cs" />
<Compile Include="Channels\NamedPipe_Specs.cs" />
<Compile Include="Channels\RequestWcf_Specs.cs" />
<Compile Include="Channels\TimerScheduler_Specs.cs" />
<Compile Include="Channels\Aggregator_Specs.cs" />
Expand Down
3 changes: 0 additions & 3 deletions src/Stact.sln
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ Global
{716A460C-0F8C-4336-8448-5ED8C24F31EB}.Release|x86.ActiveCfg = Release|Any CPU
{28B956AA-E6BB-4B8D-9B04-8BE2F45F6666}.Build|Any CPU.ActiveCfg = Build|x86
{28B956AA-E6BB-4B8D-9B04-8BE2F45F6666}.Build|Mixed Platforms.ActiveCfg = Build|x86
{28B956AA-E6BB-4B8D-9B04-8BE2F45F6666}.Build|Mixed Platforms.Build.0 = Build|x86
{28B956AA-E6BB-4B8D-9B04-8BE2F45F6666}.Build|x86.ActiveCfg = Build|x86
{28B956AA-E6BB-4B8D-9B04-8BE2F45F6666}.Build|x86.Build.0 = Build|x86
{28B956AA-E6BB-4B8D-9B04-8BE2F45F6666}.Debug|Any CPU.ActiveCfg = Debug|x86
Expand All @@ -124,7 +123,6 @@ Global
{C078394E-5E66-41EE-ADFC-1A4C46407AC5}.Build|Any CPU.ActiveCfg = Release|Any CPU
{C078394E-5E66-41EE-ADFC-1A4C46407AC5}.Build|Any CPU.Build.0 = Release|Any CPU
{C078394E-5E66-41EE-ADFC-1A4C46407AC5}.Build|Mixed Platforms.ActiveCfg = Release|Any CPU
{C078394E-5E66-41EE-ADFC-1A4C46407AC5}.Build|Mixed Platforms.Build.0 = Release|Any CPU
{C078394E-5E66-41EE-ADFC-1A4C46407AC5}.Build|x86.ActiveCfg = Release|Any CPU
{C078394E-5E66-41EE-ADFC-1A4C46407AC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C078394E-5E66-41EE-ADFC-1A4C46407AC5}.Debug|Any CPU.Build.0 = Debug|Any CPU
Expand Down Expand Up @@ -154,7 +152,6 @@ Global
{A770AB4A-F293-45B1-87F7-0AD70774A7EE}.Build|Any CPU.ActiveCfg = Release|Any CPU
{A770AB4A-F293-45B1-87F7-0AD70774A7EE}.Build|Any CPU.Build.0 = Release|Any CPU
{A770AB4A-F293-45B1-87F7-0AD70774A7EE}.Build|Mixed Platforms.ActiveCfg = Release|Any CPU
{A770AB4A-F293-45B1-87F7-0AD70774A7EE}.Build|Mixed Platforms.Build.0 = Release|Any CPU
{A770AB4A-F293-45B1-87F7-0AD70774A7EE}.Build|x86.ActiveCfg = Release|Any CPU
{A770AB4A-F293-45B1-87F7-0AD70774A7EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A770AB4A-F293-45B1-87F7-0AD70774A7EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
Expand Down

0 comments on commit 927e876

Please sign in to comment.