A
Andrew Jones
I have seen some posts here about asynchronous ICMP and I am having a little
problem with threading.
Here is what I am trying to do.
I have a large number of hosts to ping. Each host is a class, that has a
method running in it's own thread. I send out 10 ICMP packets and call the
socket.BeginReceiveFrom(...) method for each packet sent. The problem is
that the reply packets seem to all queue up and then the asynchronous
receive delegate takes the earliest received packet, regardless of whether
or not that packet is from the same Endpoint that generated the response.
Is there anyway to force the asynchronous delegate to fire only for packets
received from the corresponding endpoint? Ideally each class should only
process the replies that it generated requests for and not replies from
other hosts.
Thanks,
Andrew
problem with threading.
Here is what I am trying to do.
I have a large number of hosts to ping. Each host is a class, that has a
method running in it's own thread. I send out 10 ICMP packets and call the
socket.BeginReceiveFrom(...) method for each packet sent. The problem is
that the reply packets seem to all queue up and then the asynchronous
receive delegate takes the earliest received packet, regardless of whether
or not that packet is from the same Endpoint that generated the response.
Is there anyway to force the asynchronous delegate to fire only for packets
received from the corresponding endpoint? Ideally each class should only
process the replies that it generated requests for and not replies from
other hosts.
Thanks,
Andrew