S
Stephan Steiner
Hi
I have a networking application that periodically needs to go into sleep
mode (from an application point of view, I'm simply suspending the receiver
thread until it's time to start listening to incoming packets again). The
packets I'm interested in are UDP broadcasts, so they are simply dropped
when nobody application is listening at the specified port. However, when I
initialize my receiver, there's a socket listening at the appropriate port,
so even when I suspend reception of incoming packets, the socket buffer is
still being filled, and only when it's full, will packets be dropped. I'd
like to not have any "old" packets after re-enabling the receiver, so I have
to somehow flush the receive buffer associated to my socket, but I haven't
found any way to do so. Note that I'm not using any streams on top of the
socket (actually I'm not even use a socket directly, I'm using a UDPClient,
but it allows you to retreive the underlying socket so operations on that
level would nevertheless be possible).
Any ideas?
Regards
Stephan Steiner
I have a networking application that periodically needs to go into sleep
mode (from an application point of view, I'm simply suspending the receiver
thread until it's time to start listening to incoming packets again). The
packets I'm interested in are UDP broadcasts, so they are simply dropped
when nobody application is listening at the specified port. However, when I
initialize my receiver, there's a socket listening at the appropriate port,
so even when I suspend reception of incoming packets, the socket buffer is
still being filled, and only when it's full, will packets be dropped. I'd
like to not have any "old" packets after re-enabling the receiver, so I have
to somehow flush the receive buffer associated to my socket, but I haven't
found any way to do so. Note that I'm not using any streams on top of the
socket (actually I'm not even use a socket directly, I'm using a UDPClient,
but it allows you to retreive the underlying socket so operations on that
level would nevertheless be possible).
Any ideas?
Regards
Stephan Steiner