[성현모] Handler 비동기 처리
This commit is contained in:
Binary file not shown.
@ -53,16 +53,19 @@ namespace HubX.Library.Socket.Packet
|
|||||||
request.Data4 = jsonObject.Data4;
|
request.Data4 = jsonObject.Data4;
|
||||||
request.Data5 = jsonObject.Data5;
|
request.Data5 = jsonObject.Data5;
|
||||||
|
|
||||||
|
await Task.Run(async () =>
|
||||||
|
{
|
||||||
SystemX.Core.Communication.Http http = new();
|
SystemX.Core.Communication.Http http = new();
|
||||||
var res = await http.PostJsonAsync<Request_InsertUniqueKey,Response_InsertUniqueKy>("https://127.0.0.1:9000/UniqueKey/InsertUniqueKey", request);
|
var res = await http.PostJsonAsync<Request_InsertUniqueKey, Response_InsertUniqueKy>("https://127.0.0.1:9000/UniqueKey/InsertUniqueKey", request);
|
||||||
result = res.ToJson();
|
result = res.ToJson();
|
||||||
|
|
||||||
//json 요청이 아니면 변환
|
//json 요청이 아니면 변환
|
||||||
if (isJsonRequest == false)
|
if (isJsonRequest == false)
|
||||||
{
|
{
|
||||||
if(res != null)
|
if (res != null)
|
||||||
result = $"{res.Identity},{res.Result}";
|
result = $"{res.Identity},{res.Result}";
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ClientSession clientSession = session as ClientSession;
|
ClientSession clientSession = session as ClientSession;
|
||||||
@ -94,12 +97,14 @@ namespace HubX.Library.Socket.Packet
|
|||||||
}
|
}
|
||||||
|
|
||||||
string result = string.Empty;
|
string result = string.Empty;
|
||||||
//insert DB
|
//select DB
|
||||||
if (jsonObject != null)
|
if (jsonObject != null)
|
||||||
{
|
{
|
||||||
Request_SelectUniqueKey request = new Request_SelectUniqueKey();
|
Request_SelectUniqueKey request = new Request_SelectUniqueKey();
|
||||||
request.Identity = jsonObject.Identity;
|
request.Identity = jsonObject.Identity;
|
||||||
|
|
||||||
|
await Task.Run(async() =>
|
||||||
|
{
|
||||||
SystemX.Core.Communication.Http http = new();
|
SystemX.Core.Communication.Http http = new();
|
||||||
var res = await http.PostJsonAsync<Request_SelectUniqueKey, Response_SelectUniqueKy>("https://127.0.0.1:9000/UniqueKey/SelectUniqueKey", request);
|
var res = await http.PostJsonAsync<Request_SelectUniqueKey, Response_SelectUniqueKy>("https://127.0.0.1:9000/UniqueKey/SelectUniqueKey", request);
|
||||||
result = res.ToJson();
|
result = res.ToJson();
|
||||||
@ -110,6 +115,7 @@ namespace HubX.Library.Socket.Packet
|
|||||||
if (res != null)
|
if (res != null)
|
||||||
result = $"{res.Identity},{res.Data1},{res.Data2},{res.Data3},{res.Data4},{res.Data5}";
|
result = $"{res.Identity},{res.Data1},{res.Data2},{res.Data3},{res.Data4},{res.Data5}";
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ClientSession clientSession = session as ClientSession;
|
ClientSession clientSession = session as ClientSession;
|
||||||
|
|||||||
Reference in New Issue
Block a user