In the file, free5gc\NFs\n3iwf\internal\ngap\handler\handler.go
the code segment in the func HandleDownlinkNASTransport
maxRetryTimes := 3
for i := 0; i < maxRetryTimes; i++ {
if n3iwfUe.TCPConnection == nil {
if i == (maxRetryTimes - 1) {
ngapLog.Warn(
“No connection found for UE to send NAS message. This message will be cached in N3IWF”)
n3iwfUe.TemporaryCachedNASMessage = nasEnv
return
} else {
ngapLog.Warn(“No NAS signalling session found, retry…”)
}
time.Sleep(500 * time.Millisecond)
} else {
break
}
}
When the condition (n3iwfUe.TCPConnection == nil) is TRUE and while the thread is asleep
the UE TCP connects to N3IWF by executing the code in the file
free5gc\NFs\n3iwf\internal\nwucp\service\service.go in the function func listenAndServe(tcpListener net.Listener)
and the statement executes
ue.TCPConnection = connection
Would the n3iwfUe.TCPConnection == nil evaluate to FALSE on the next waking up thread.
I am not familiar with GO. I just do not see this happening.