Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
S

Shanky4

@Shanky4
About
Posts
4
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Receive UDP packet from multiple default gateway
    S Shanky4

    Thanks for your valuable suggestion. I am trying all this, I will update you once I will collect the result.

    C / C++ / MFC c++ sysadmin

  • Receive UDP packet from multiple default gateway
    S Shanky4

    Also as I can see the data in wireshark, looks like PC is receiving this data but it is not reaching to application

    C / C++ / MFC c++ sysadmin

  • Receive UDP packet from multiple default gateway
    S Shanky4

    Thanks for going through it. I did not try to bind the socket with specific IP address. Also this is not a requirement for me. I will give a try just to verify if it is possible but my intention is to receive data from all the adapter connected to same netwoek(router). Earlier I am using DHCP so that time it was not a problem for me cause all the adapter was getting the same default gateway but now I am switching to static where user can put any IP address with different default gateway.

    C / C++ / MFC c++ sysadmin

  • Receive UDP packet from multiple default gateway
    S Shanky4

    Hi,

    I am writing an application to receive a data from adapter. Adapter is brodcasting UDP data.
    So in my case I have two adapter which is connected to same router having following IP information -

    1. Adapter 1 :-
      IP : 192.168.1.32
      Default Gateway : 192.168.1.1
      Subnet Mask : 255.255.255.0
    2. Adapter 2 :-
      IP : 192.168.4.33
      Default Gateway : 192.168.4.1
      Subnet Mask : 255.255.255.0

    Here is the router detail :

    Default Gateway : 192.168.1.1
    Subnet Mask : 255.255.255.0

    PC is also connected to same router.
    Application written in C++ is configure to receive data from any IP address.
    m_nFamily = AF_INET;
    m_nType = SOCK_DGRAM;
    m_nProtocol = IPPROTO_UDP;
    m_SockAddr.sin_addr.s_addr = INADDR_ANY;
    m_SockAddr.sin_family = AF_INET;

    In my case I can receive data coming from Adapter 1 but can not receive data coming from Adapter 2.
    But the data coming from both the adapter I can see in Wireshark.

    Work around to receive data from Adapter 2 : To receive data from adapter 2, I need to change the wireless network connection property for IPV4 and need to change "obtain IP address automatically" to "Use the following address":
    Used following data to configure manually :
    IP : 192.168.4.31
    Default Gateway : 192.168.4.1
    Subnet Mask : 255.255.255.0

    But after doing this application don't see the message coming from adapter 1.
    But the data from both the adapter can be seen in wireshark.

    My goal is to receive data from both the adapter simultaneously.

    C / C++ / MFC c++ sysadmin
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups