Raw socket not receiving data when matching UDP socket is present
- From: Ajay Lele <ajay.lele@xxxxxxxxx>
- Date: Mon, 14 Sep 2009 16:38:40 -0700 (PDT)
Hi,
I am writing an application where IP TOS value in incoming UDP packet
needs to be echoed back in the reply UDP packet (platform is XP..it
also needs to work on Vista)
To achieve this, I am trying to use raw socket to read the packet and
get the value of TOS byte and a UDP socket along with Traffic Control
APIs to set the TOS value in reply packet. Why 2 sockets..why not use
the raw socket itself to send the reply? - thats because packets sent
from raw socket seems to bypass TC. I have posted that question on
another thread but no luck so far
http://social.msdn.microsoft.com/Forums/en-US/networkqosqwave/thread/c23f4bda-6313-461c-9f5c-4c9bc9d7d46b
So with the 2 socket approach, the issue I am facing is that, raw
socket is not able to see packets coming for the UDP socket (I mean
packets destined for port to which the UDP socket is bound). As soon
as I close the UDP socket, next packet received which is destined for
this port causes recvfrom() on the raw socket to return. In this
scenario, is there a way for the incoming packet to be received by raw
socket (I dont care if receive works for UDP socket)
Thanks in advance
.
- Prev by Date: Outsource to Freelancers, IT Companies, Programmer
- Next by Date: Socket still listening after crash
- Previous by thread: Outsource to Freelancers, IT Companies, Programmer
- Next by thread: Socket still listening after crash
- Index(es):
Relevant Pages
|