Device Linking problem

Hi,
I have a rendezvous channel registration screen in my roku channel.It will generate a linking code on first call.And then after typing and linking the code in the channel site , the prelink url will be polled after each 15 seconds.But i am getting the successful registration response only during the first prelink call ( Note : only if we have linked the device before the first 15 seconds) .But if i link the device in subsequent intervals after the first prelink call , i will be getting registration failure response. Do anyone have some corrective measures regarding this ?

But the same thing gives successful output on web debugging tools like Charles proxy

below i have given the code snippet :


Function doRegistration()

 while true 
    msg = Wait(15, regscreen.GetMessagePort())   
    print "sending the request.."
    if msg = invalid
          print "Request No :";count.ToStr()
          if timer.TotalSeconds() >= m.regcodeExpireTime
              ShowDialog1Button("","This code has expired. Press OK to get a new one","Ok") 
              regscreen.SetRegistrationCode("")
              regscreen.Show()
              goto TOK
          end if
  
         status = checkRegistrationStatus(regCode)
         if status = 0 
              print "registration successful in doRegistration()"
              print FormatTime(time.TotalSeconds(),"Time taken to register : ")              
              posterfacade = CreateObject("roPosterScreen")  'facade screen
              posterfacade.ShowMessage("Loading...")
              posterfacade.Show()
              regscreen.Close()
              canvas.Close()
              return status
              else if status > 0
                  print "registration pending in doRegistration()"
              end if
   end if
  end while
end Function

debugg output response during the first prelink call ( Note : if i have linked the device after the first 15 seconds):

sending the request..
Request No :1
transfer is completed and status is :1
invalid response code 404 and response not received.
url :https://someapi.com
failure reason :The requested URL returned error: 404
registration pending in doRegistration()
sending the request..
Request No :2
transfer is completed and status is :1
invalid response code 404 and response not received.
url :https://someapi.com
failure reason :The requested URL returned error: 404
registration pending in doRegistration()

… continues

But in case if i had linked the device before the first 15 seconds, i will get the successful registration result.Can anyone have an inner view into that ?

Thanks.