Click here to Skip to main content
15,892,059 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionAn algorithm question Pin
econy26-Mar-14 15:53
econy26-Mar-14 15:53 
AnswerRe: An algorithm question Pin
Richard MacCutchan26-Mar-14 23:08
mveRichard MacCutchan26-Mar-14 23:08 
GeneralRe: An algorithm question Pin
econy27-Mar-14 3:38
econy27-Mar-14 3:38 
AnswerRe: An algorithm question Pin
CPallini28-Mar-14 10:31
mveCPallini28-Mar-14 10:31 
GeneralRe: An algorithm question Pin
econy31-Mar-14 4:12
econy31-Mar-14 4:12 
GeneralRe: An algorithm question Pin
chaau1-Apr-14 17:17
chaau1-Apr-14 17:17 
AnswerRe: An algorithm question Pin
Stefan_Lang3-Apr-14 3:29
Stefan_Lang3-Apr-14 3:29 
QuestionReceive UDP packet from multiple default gateway Pin
Shanky426-Mar-14 5:18
Shanky426-Mar-14 5:18 
CSS
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.

QuestionRe: Receive UDP packet from multiple default gateway Pin
Richard MacCutchan26-Mar-14 5:32
mveRichard MacCutchan26-Mar-14 5:32 
AnswerRe: Receive UDP packet from multiple default gateway Pin
Shanky426-Mar-14 6:55
Shanky426-Mar-14 6:55 
GeneralRe: Receive UDP packet from multiple default gateway Pin
Shanky426-Mar-14 7:05
Shanky426-Mar-14 7:05 
GeneralRe: Receive UDP packet from multiple default gateway Pin
Richard MacCutchan26-Mar-14 7:14
mveRichard MacCutchan26-Mar-14 7:14 
AnswerRe: Receive UDP packet from multiple default gateway Pin
Jochen Arndt26-Mar-14 7:17
professionalJochen Arndt26-Mar-14 7:17 
GeneralRe: Receive UDP packet from multiple default gateway Pin
Shanky426-Mar-14 7:29
Shanky426-Mar-14 7:29 
QuestionADO Connection ptr under Windows 7 fails in Windowx XP Pin
aaandrei26-Mar-14 4:55
aaandrei26-Mar-14 4:55 
AnswerRe: ADO Connection ptr under Windows 7 fails in Windowx XP Pin
Jochen Arndt26-Mar-14 5:07
professionalJochen Arndt26-Mar-14 5:07 
QuestionHow to use global hook with WH_GETMESSAGE Pin
cedricvictor26-Mar-14 2:44
cedricvictor26-Mar-14 2:44 
AnswerRe: How to use global hook with WH_GETMESSAGE Pin
Richard MacCutchan26-Mar-14 5:26
mveRichard MacCutchan26-Mar-14 5:26 
GeneralRe: How to use global hook with WH_GETMESSAGE Pin
cedricvictor26-Mar-14 16:57
cedricvictor26-Mar-14 16:57 
GeneralRe: How to use global hook with WH_GETMESSAGE Pin
Richard MacCutchan26-Mar-14 22:52
mveRichard MacCutchan26-Mar-14 22:52 
Questionstd::wcout can't print out Arabic chars and some mathmatical symbols Pin
Falconapollo25-Mar-14 23:59
Falconapollo25-Mar-14 23:59 
QuestionWhich among following statements c/c++ code is faster? Pin
shaktikanta24-Mar-14 22:59
shaktikanta24-Mar-14 22:59 
AnswerRe: Which among following statements c/c++ code is faster? Pin
Jochen Arndt25-Mar-14 0:20
professionalJochen Arndt25-Mar-14 0:20 
GeneralRe: Which among following statements c/c++ code is faster? Pin
Heng Xiangzhong10-Apr-14 1:19
Heng Xiangzhong10-Apr-14 1:19 
AnswerRe: Which among following statements c/c++ code is faster? Pin
Maximilien25-Mar-14 1:01
Maximilien25-Mar-14 1:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.