See my source code attached in SNTPClient Class thread. Module SNTPClient.bas has comments containing @@@ you can do a find on.
I wanted/meant to call Close after using a UDPSocket object, assuming I might later call Initialize to make subsequent use of the same instance. This doesn't seem to work as I expected, though I may have been using it incorrectly or at the wrong time (i.e. from inside the PacketArrival event handler).
As a workaround the code discards instances after use, creating new instances as required.
To test the issue, you'd have to uncomment one line of code marked with @@@ in the PacketArrival handler Sub and then move the declaration of the instance of SNTPClient in the caller/parent to the module level instead of a local declaration.
I wanted/meant to call Close after using a UDPSocket object, assuming I might later call Initialize to make subsequent use of the same instance. This doesn't seem to work as I expected, though I may have been using it incorrectly or at the wrong time (i.e. from inside the PacketArrival event handler).
As a workaround the code discards instances after use, creating new instances as required.
To test the issue, you'd have to uncomment one line of code marked with @@@ in the PacketArrival handler Sub and then move the declaration of the instance of SNTPClient in the caller/parent to the module level instead of a local declaration.