0

Let's say a source A is sending me an unknown number of messages using UDP. How can I intercept all those messages? This is the complete scenario:

  • Send 7 messages
  • Wait for their ACKs
  • Process ACKs
  • Send another batch
  • Repeat...

Problems: (1) I don't know how many messages arrive, some may get lost and some are repeated, and (2) I might be be doing something else later, so I cannot wait forever.

ToniAz
  • 430
  • 1
  • 6
  • 24

2 Answers2

0

This might help you: http://wiki.python.org/moin/UdpCommunication Seems like you can send messages in a very easy way. Of course you'll have to build the whole 7 messages then restart logic around it.

pypat
  • 1,096
  • 1
  • 9
  • 19
0

You could have a message loop continuously listening and processing received packets and putting them on a queue then read them at your leisure...

However you would need to implement you own ACKs taking into account the possibilities of lost and duplicates (if your application is concerned about them).. Which begs the question - why not use TCP?

markmnl
  • 11,116
  • 8
  • 73
  • 109