Click here to Skip to main content
15,912,069 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionado in vc++ Pin
GANsJob26-May-06 2:24
GANsJob26-May-06 2:24 
QuestionRe: ado in vc++ Pin
David Crow26-May-06 2:35
David Crow26-May-06 2:35 
AnswerRe: ado in vc++ Pin
GANsJob26-May-06 2:45
GANsJob26-May-06 2:45 
GeneralRe: ado in vc++ Pin
David Crow26-May-06 3:13
David Crow26-May-06 3:13 
AnswerRe: ado in vc++ Pin
Milton Karimbekallil26-May-06 2:39
Milton Karimbekallil26-May-06 2:39 
QuestionCalling VB function in Win32 Dll Pin
Arun Tayal26-May-06 1:30
Arun Tayal26-May-06 1:30 
AnswerRe: Calling VB function in Win32 Dll Pin
Milton Karimbekallil26-May-06 2:13
Milton Karimbekallil26-May-06 2:13 
QuestionOnReceive is not getting called, Why? Pin
syntaxed26-May-06 1:23
syntaxed26-May-06 1:23 
Im trying somewhat simplest idea of sockets app using multicast.

Following is what SockApp1 does:
1) OnButtonCreate() creates the port, default OS assigned port. Create(0, SOCK_DGRAM)

m_pUDPSocket->Create(0, SOCK_DGRAM);

2) When OnButtonInitMulti() the mutlicast group(ip/port) is initialized.

// set up destination address <br />
memset(&m_addrMulti,0,sizeof(m_addrMulti));<br />
m_addrMulti.sin_family		=AF_INET;<br />
m_addrMulti.sin_addr.s_addr	=inet_addr(MULTIADDR);<br />
m_addrMulti.sin_port		=htons(MULTIPORT);


3) When OnButtonSend()it sends the data to the group.

SendTo(m_sendBuffer, m_sendBuffer.GetLength(), <br />
(const SOCKADDR* )&m_addrMulti, sizeof(m_addrMulti));


SockApp2 with following buttons clicked:
1) OnButtonCreate() creates the port, default OS assigned port. Create(0, SOCK_DGRAM)

m_pUDPSocket->Create(0, SOCK_DGRAM);

2) OnButtonJoinMulti() joins the multicast group.

ip_mreq mreq;<br />
memset(&mreq, 0, sizeof(ip_mreq));<br />
mreq.imr_multiaddr.s_addr = inet_addr(MULTIADDR);<br />
mreq.imr_interface.s_addr = htonl(MULTIPORT);<br />
<br />
if(SOCKET_ERROR == SetSockOpt(IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)))<br />
{<br />
	AfxMessageBox("Error: Unable to add membership");<br />
	return -1;<br />
}


here...
#define MULTIADDR	"224.0.1.129"<br />
#define MULTIPORT319	5009


Now, SockApp1, when i click onto the Send button, OnButtonSend() shud get called in which im doing the SendTo() thing. Uptill here the App1/App2 both are working fine, and the data is being sent successfully, this im sure.

The problem is, that SockApp2, which joined the group, is unable to receive the data being sent from SockApp1.

Now, SockApp1 and SockApp2 are actually a single app, called SockApp. I added SockApp1/2 names just for the clarity of the question and understanding.

At this moment, im just wondering... why SockApp2 is not receiving the data from SockApp1??? Sigh | :sigh:

Any ideas why?WTF | :WTF:


Best regards,
JT!
AnswerRe: OnReceive is not getting called, Why? Pin
syntaxed27-May-06 5:36
syntaxed27-May-06 5:36 
QuestionAssertion error Pin
Anu_Bala26-May-06 1:20
Anu_Bala26-May-06 1:20 
AnswerRe: Assertion error Pin
Hamid_RT26-May-06 1:24
Hamid_RT26-May-06 1:24 
GeneralRe: Assertion error Pin
Anu_Bala26-May-06 1:29
Anu_Bala26-May-06 1:29 
GeneralRe: Assertion error Pin
Hamid_RT26-May-06 1:35
Hamid_RT26-May-06 1:35 
AnswerRe: Assertion error [modified] Pin
Stephen Hewitt26-May-06 1:55
Stephen Hewitt26-May-06 1:55 
QuestionRe: Assertion error Pin
David Crow26-May-06 2:36
David Crow26-May-06 2:36 
AnswerRe: Assertion error Pin
Dennis Gourjii26-May-06 2:45
Dennis Gourjii26-May-06 2:45 
AnswerRe: Assertion error Pin
Bram van Kampen28-May-06 14:13
Bram van Kampen28-May-06 14:13 
Questionbackwards compatibility Pin
palako26-May-06 1:17
palako26-May-06 1:17 
AnswerRe: backwards compatibility Pin
Milton Karimbekallil26-May-06 2:31
Milton Karimbekallil26-May-06 2:31 
QuestionSystem Idle State Pin
aks.26-May-06 0:47
aks.26-May-06 0:47 
AnswerRe: System Idle State Pin
Garth J Lancaster26-May-06 1:10
professionalGarth J Lancaster26-May-06 1:10 
GeneralRe: System Idle State Pin
aks.26-May-06 1:50
aks.26-May-06 1:50 
QuestionRe: System Idle State Pin
David Crow26-May-06 2:38
David Crow26-May-06 2:38 
AnswerRe: System Idle State Pin
aks.26-May-06 4:06
aks.26-May-06 4:06 
AnswerRe: System Idle State Pin
PJ Arends26-May-06 8:38
professionalPJ Arends26-May-06 8:38 

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.