On Thu, 31 Jul 2008 02:42:02 -0700, Marino <ma****@dir.hrwrote:
Hello everybody!
I am trying to write a little piece of code that would receive some
data over the network from an alarm system device. The device sends data
with a defined data packet structure. The software should listen 24 hour
a
day. Is there a better way than creating a thread with listener that
awaits
for a connection?
Does the device require the use of TCP? If so, then setting up a listener
(whether with an explicit thread, or using an asynchronous call) is your
requirement.
If the device supports UDP, then it's possible you'd find that to be a
useful alternative, albeit possibly more complicated if you have to also
ensure that the notification was received (the device would have to expect
some sort of acknowledgement and keep resending the notification until it
receive that).
Either way should work fine.
Pete