title: Windows 7 upgrade, UDP Broadcast issue
body: <p>I am new to this environment as far as UDP protocols and sending/receiving data via networks.  I have read the other post regarding this kind of issue but I am not sure how to fix my problem:</p>
  
  <p>I have just upgraded a PC to Windows 7 from XP. This upgrade was due to my application needs to run on Win7.  I have NOT changed the was our UDP stream is broadcasted.  With the upgrade I can no longer run the older version of my application becasue the UDP stream doesn't seam to get to my application.</p>
  
  <p>I have turned off all firewalls and am running everything as admin. </p>
  
  <p>This is how my setup is:</p>
  
  <p>Code is running on ip: 192.168.2.1
  UDP is sent from 192.168.2.1 to 192.168.2.87 and then broadcasted to 192.168.2.255</p>
  
  <p>I used to be able to see this UDP stream with my old application on a seperate computer: 192.168.2.12</p>
  
  <p>If I change my UDP stream to go directly to 192.168.2.12 ip, then my application works, but then the UDP is not broadcasted anymore. I need the UDP to be able to be read by more than one computer. </p>
  
  <p>Here is my wireshark out put for the UDP Stream:</p>
  
  <pre><code>Source: 192.168.2.87 
  Destination: 192.168.2.255 
  Protocol: UDP Info: 
  Sorce Port: 6601 Destination Port: 6601
  </code></pre>
  
  <p>I have tried hard coding my c-code to listen to any possibility I can think of, aka the sender addr function:</p>
  
  <pre><code>senderAddr.sin_addr.s_addr = htonl(INADDR_ANY);
  </code></pre>
  
  <p>To something like: </p>
  
  <pre><code> senderAddr.sin_addr.s_addr = inet_addr("192.168.2.212")
  </code></pre>
  
  <p>This is the code to init the I/O buffer: </p>
  
  <pre><code>// UDP Receiver Declarations -
  SOCKET SockIn = INVALID_SOCKET;
  SOCKADDR_IN senderAddr;
  int senderSize = sizeof(senderAddr);
  u_short PortIn = 6601;
  
  int timeout = 1;
  
  //===================&lt;Callbacks::Callbacks&gt;==================
  //
  // Summary: Constructor
  //
  //=============================================================================
  Callbacks::Callbacks(RTUserIntegrationI &amp;a_rIntegration)
  : m_rIntegration(a_rIntegration)
  , m_pUDPInput(NULL)
  
  {
  }
  
  //=====================&lt;Callbacks::~Callbacks&gt;===============
  //
  // Summary: Destructor
  //
  //=============================================================================
  Callbacks::~Callbacks()
  {
  }
  
  //=====================&lt;Callbacks::InitIOBuffers&gt;====================
  //
  // Summary: Init function for the IO buffer
  //
  //=============================================================================
  void Callbacks::vInitIOBuffers()
  {
      BOOL bOptVal = TRUE;
          int bOptLen = sizeof(BOOL);
  
      WSADATA WSAData;
  
      UInt Size = 0;
    // UDP Declarations -
  
  
     // Initialize the member pointers to buffers
  
      bufferin = m_rIntegration.pGetIOBuffer(Input_Buffer);
      if (bufferin != NULL)
      m_pUDPInput = static_cast&lt;InputData*&gt;(bufferin-&gt;pGetDataAddress(Size));
  
    // UDP Receive -
     if (WSAStartup(MAKEWORD(2, 2), &amp;WSAData) != 0)
     {
         printf("\nCould not open WSA connection");
         WSACleanup();
     }
  
     SockIn = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
     if (SockIn == INVALID_SOCKET)
     {
         printf("\nCould not create socket.");
         closesocket(SockIn);
         WSACleanup();
     }
  
     senderAddr.sin_family = AF_INET;
     senderAddr.sin_port = htons(PortIn);
     senderAddr.sin_addr.s_addr = htonl(INADDR_ANY);
  
        if (setsockopt(SockIn, SOL_SOCKET, SO_REUSEADDR, (char*)&amp;bOptVal, bOptLen) != INVALID_SOCKET)
     {
         printf("\nSet SO_REUSEADDR: ON.");
     }
  
     if (bind(SockIn, (struct sockaddr *) &amp;senderAddr, senderSize) == -1)
     {
         printf("\nCould not bind socket.");
         closesocket(SockIn);
         WSACleanup();
     }
  
     setsockopt(SockIn, SOL_SOCKET, SO_RCVTIMEO, (char*) &amp;timeout, sizeof(timeout));
  
  
  
  }
  </code></pre>
  
  <p>I have the receive port number hard coded to 6601.</p>
  
  <p>The code above works fine and the computer sees and reads the broadcasted UDP in Windows XP but ceases to work in Windows 7. </p>
  
  <p>Any suggestions would be greatly appreciated.</p>
  
  <p>ADDED:</p>
  
  <p>192.168.2.1 generates the UDP stream--->sent to 192.168.2.87---> broadcasted on 192.168.2.255 ---> Notheing has changed on any of those computers....... I then have two computers (one XP and one Windows 7) than listen to the 2.255 ip. XP is getting the UDP and Win7 is not.</p>