[성현모] Http, Socket 통신 추가

This commit is contained in:
SHM
2025-04-21 08:30:59 +09:00
parent 1bfc56f437
commit a12a3949bf
25 changed files with 1370 additions and 264 deletions

View File

@ -6,10 +6,22 @@
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<WarningLevel>9999</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<WarningLevel>9999</WarningLevel>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\HubX.Library\HubX.Library.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="SystemX.Core">
<HintPath>..\..\DLL\SystemX.Core.dll</HintPath>

View File

@ -1,4 +1,7 @@
using SystemX.Core.Log4net;
using HubX.Library.Socket.Session;
using HubX.Server;
using System.Net;
using SystemX.Core.Communication;
var builder = WebApplication.CreateBuilder(args);
@ -21,6 +24,30 @@ if (app.Environment.IsDevelopment())
Log4net.WriteLine("Run");
Log4net.WriteLine("Custom LogLevel",LogType.DB);
WeatherForecast weatherForecast = new WeatherForecast();
weatherForecast.Summary = "so hot";
var strJson = weatherForecast.ToJson();
var deep = weatherForecast.DeepCopy();
deep.Summary = "so cool";
var rr = strJson.ToObject<WeatherForecast>();
Task.Run(async() =>
{
await Task.Delay(2000);
Listener _listener = new Listener();
// string host = Dns.GetHostName();
IPHostEntry ipHost = Dns.GetHostEntry("127.0.0.1");
IPAddress ipAddr = ipHost.AddressList[0];
IPEndPoint endPoint = new IPEndPoint(ipAddr, 7777);
_listener.Init(endPoint, () => { return SessionManager.Instance.Generate(); });
Console.WriteLine("Listening...");
});
app.UseHttpsRedirection();
app.UseAuthorization();

View File

@ -1,4 +1,31 @@
{
{
"profiles": {
"http": {
"commandName": "Project",
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": true,
"applicationUrl": "http://localhost:5103"
},
"https": {
"commandName": "Project",
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": true,
"applicationUrl": "https://localhost:7163;http://localhost:5103"
},
"IIS Express": {
"commandName": "IISExpress",
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
},
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
@ -7,35 +34,5 @@
"applicationUrl": "http://localhost:33125",
"sslPort": 44383
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "http://localhost:5103",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:7163;http://localhost:5103",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
}