This commit is contained in:
Chris Forbes
2009-11-16 18:40:43 +13:00
parent f22db9324e
commit e30f84d16e
4 changed files with 164 additions and 0 deletions

43
OpenRA.Server/Class1.cs Normal file
View File

@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.Threading;
namespace OpenRA.Server
{
class Program
{
static void Main(string[] args)
{
var left = new TcpListener(1234);
left.Start();
var right = new TcpListener(1235);
right.Start();
var l = left.AcceptTcpClient().GetStream();
var r = right.AcceptTcpClient().GetStream();
var ll = new Thread(RW(l, r));
var rr = new Thread(RW(r, l));
ll.Start();
rr.Start();
ll.Join();
}
static ThreadStart RW(NetworkStream a, NetworkStream b)
{
return () =>
{
var buf = new byte[4096];
while (true)
{
var len = a.Read(buf, 0, 4096);
b.Write(buf, 0, len);
}
};
}
}
}

View File

@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{76F621A1-3D8E-4A99-9F7E-B071EB657817}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenRA.Server</RootNamespace>
<AssemblyName>OpenRA.Server</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<StartupObject>
</StartupObject>
</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>
<PlatformTarget>x86</PlatformTarget>
</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.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Class1.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</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>

View File

@@ -0,0 +1,36 @@
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("OpenRA.Server")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OpenRA.Server")]
[assembly: AssemblyCopyright("Copyright © 2009")]
[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("09d30fc4-df3f-4f6a-b9bd-1819c2a23c62")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -13,6 +13,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PaletteMatch", "PaletteMatc
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SequenceEditor", "SequenceEditor\SequenceEditor.csproj", "{230F65CE-A6DE-4235-8B38-13A3D606C7F7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Server", "OpenRA.Server\OpenRA.Server.csproj", "{76F621A1-3D8E-4A99-9F7E-B071EB657817}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug (x86)|Any CPU = Debug (x86)|Any CPU
@@ -135,6 +137,27 @@ Global
{230F65CE-A6DE-4235-8B38-13A3D606C7F7}.Release|Mixed Platforms.ActiveCfg = Release|x86
{230F65CE-A6DE-4235-8B38-13A3D606C7F7}.Release|Mixed Platforms.Build.0 = Release|x86
{230F65CE-A6DE-4235-8B38-13A3D606C7F7}.Release|Win32.ActiveCfg = Release|x86
{76F621A1-3D8E-4A99-9F7E-B071EB657817}.Debug (x86)|Any CPU.ActiveCfg = Debug|Any CPU
{76F621A1-3D8E-4A99-9F7E-B071EB657817}.Debug (x86)|Any CPU.Build.0 = Debug|Any CPU
{76F621A1-3D8E-4A99-9F7E-B071EB657817}.Debug (x86)|Mixed Platforms.ActiveCfg = Debug|Any CPU
{76F621A1-3D8E-4A99-9F7E-B071EB657817}.Debug (x86)|Mixed Platforms.Build.0 = Debug|Any CPU
{76F621A1-3D8E-4A99-9F7E-B071EB657817}.Debug (x86)|Win32.ActiveCfg = Debug|Any CPU
{76F621A1-3D8E-4A99-9F7E-B071EB657817}.Debug (x86)|Win32.Build.0 = Debug|Any CPU
{76F621A1-3D8E-4A99-9F7E-B071EB657817}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{76F621A1-3D8E-4A99-9F7E-B071EB657817}.Debug|Any CPU.Build.0 = Debug|Any CPU
{76F621A1-3D8E-4A99-9F7E-B071EB657817}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{76F621A1-3D8E-4A99-9F7E-B071EB657817}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{76F621A1-3D8E-4A99-9F7E-B071EB657817}.Debug|Win32.ActiveCfg = Debug|Any CPU
{76F621A1-3D8E-4A99-9F7E-B071EB657817}.Release (x86)|Any CPU.ActiveCfg = Release|Any CPU
{76F621A1-3D8E-4A99-9F7E-B071EB657817}.Release (x86)|Any CPU.Build.0 = Release|Any CPU
{76F621A1-3D8E-4A99-9F7E-B071EB657817}.Release (x86)|Mixed Platforms.ActiveCfg = Release|Any CPU
{76F621A1-3D8E-4A99-9F7E-B071EB657817}.Release (x86)|Mixed Platforms.Build.0 = Release|Any CPU
{76F621A1-3D8E-4A99-9F7E-B071EB657817}.Release (x86)|Win32.ActiveCfg = Release|Any CPU
{76F621A1-3D8E-4A99-9F7E-B071EB657817}.Release|Any CPU.ActiveCfg = Release|Any CPU
{76F621A1-3D8E-4A99-9F7E-B071EB657817}.Release|Any CPU.Build.0 = Release|Any CPU
{76F621A1-3D8E-4A99-9F7E-B071EB657817}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{76F621A1-3D8E-4A99-9F7E-B071EB657817}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{76F621A1-3D8E-4A99-9F7E-B071EB657817}.Release|Win32.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE