From WebForm to WinForm Modification
hk-moon opened this issue · 3 comments
Hi,
I will slice change your ASP.NET program and will make a WinForm program.
But some issues is generating now.
Please check and advice of return.
The test procedure is Setting --> HSMS , OK -->Action ---> Connection
The issue message is
12:32:05::595 : HsmsActiveMode = False
12:32:05::606 : HsmsIPAddress = 127.0.0.1
12:32:05::609 : HsmsPort = 5100
12:32:05::612 : HsmsDeviceID = 0
12:32:05::615 : HsmsT3 = 45000
12:32:05::618 : HsmsT5 = 10000
12:32:05::620 : HsmsT6 = 5000
12:32:05::622 : HsmsT7 = 10000
12:32:05::625 : HsmsT8 = 5000
12:32:05::628 : HsmsTestRequestTime = 60000
12:32:05::631 : HsmsSocketBufferSize = 8192
12:32:09.262 : Mode:Passive
12:32:09.266 : Remote IP:127.0.0.1
12:32:09.269 : Port:5100
12:32:09.272 : Wait Connect....
"
12:32:32.667 : System.NullReferenceException: 개체 참조가 개체의 인스턴스로 설정되지 않았습니다.
위치: iScanHSMS.HsmsConnection.ChangeConnectionState(ConnectionState state) 파일 C:\Users\hkmoo\Desktop\SECS\iScanHSMS\iScanHSMS_20231113-1\iScanHSMS_20231113\iScanHSMS\HsmsConnection.cs:줄 304
위치: iScanHSMS.HsmsConnection.<>c__DisplayClass41_1.<<-ctor>b__5>d.MoveNext() 파일 C:\Users\hkmoo\Desktop\SECS\iScanHSMS\iScanHSMS_20231113-1\iScanHSMS_20231113\iScanHSMS\HsmsConnection.cs:줄 220
"
iScanHSMS_20231113.zip
SYSTEM.20231113.log
Hi hk_mood:
This is an error related to developers. You declared a private static ISecsGemLogger _logger; but did not assign a value to it, resulting in a System.NullReferenceException. The solution is as follows: assign a value to the variable.
public HsmsConnection(SecsGemOptions _configuration, ISecsGemLogger _logger )
{
//hk
//JctMQTT.Handle_Received_Application_Message();
HsmsConnection._logger = _logger;
}
I will change your code but can't find any solutions.
Please commant me.
private async void SendDataMessage_Completed(object sender, SocketAsyncEventArgs e)
{
;
await completeToken.Task.WaitAsync(TimeSpan.FromMilliseconds(T3)).ConfigureAwait(false);
===> ? (Winform Net 4.7.2)
:
}
Hi hk-mon:
You can refer to this website.
https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task.waitasync?view=net-7.0#system-threading-tasks-task-waitasync(system-timespan)
It is only applicable to .NET 6 and above versions.