[성현모] 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

@ -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();