Using reliable multicast (Pragmatic General Multicast) not returning from accept
-
Thursday, July 26, 2012 10:06 AM
I am recently working on a project, which requires transmit data from one sender to multiple receivers reliably. So I took the PGM approach from Microsoft. The problem is after I started the receiver, it stopped in accept. It looks to me waiting for incoming connections. According to MS, after the receiver returns from accept. It returns a client socket, which is to be used for receiving. After I started the sender, connect and send are called. I can see from the wireshark log, the packages did have been sent from sender and arrived at the receiver. I can also see from the wireshark log the IP address of receiver joining the mcast group. But the receiver application never returns from calling "accept".
Could anyone help me out of this?
Thanks a lot.
Receiver
WSAStartup(wVersionRequested, &wsaData) SOCKET sock = socket (AF_INET, SOCK_RDM, IPPROTO_RM); salocal.sin_family = AF_INET; salocal.sin_port = htons( mPort ); salocal.sin_addr.s_addr = inet_addr( PGM_MULTICAST_ADDRESS.c_str() ); int errCode = bind (sock, (SOCKADDR *)&salocal, sizeof(salocal)); errCode = listen (sock, 10); ULONG localif = inet_addr("10.0.12.10"); setsockopt(sock, IPPROTO_RM, RM_ADD_RECEIVE_IF, (char *)&localif, sizeof(localif)); sasessionsz = sizeof(sasession); mClientSocket = accept (sock, (SOCKADDR *)&sasession, &sasessionsz);Sender
WSAStartup(wVersionRequested, &wsaData) SOCKADDR_IN salocal, sasession; mSocket = socket (AF_INET, SOCK_RDM, IPPROTO_RM); salocal.sin_family = AF_INET; salocal.sin_port = htons (0); // Port is ignored here salocal.sin_addr.s_addr = htonl (INADDR_ANY); errCode = ::bind (mSocket, (SOCKADDR *)&salocal, sizeof(salocal)); sasession.sin_family = AF_INET; sasession.sin_port = htons ( mPort ); sasession.sin_addr.s_addr = inet_addr ( PGM_MULTICAST_ADDRESS.c_str() ); errCode = ::connect (mSocket, (SOCKADDR *)&sasession, sizeof(sasession));
All Replies
-
Friday, July 27, 2012 7:28 AM
What platform do we have on both the sides here?
Thanks
Sudhir
-
Friday, July 27, 2012 9:20 AMthey are two Windows 7 x64 platform
-
Friday, July 27, 2012 9:30 AM
I am not sure if this KB will be relevant in your case, but can you please check if KB 2554746 is installed on your machine or not?
Thanks
Sudhir
-
Friday, July 27, 2012 10:14 AM
Well, thanks for the info.
It is neither installed on my computer, nor can I install it. The error message is "the update is not applicable to your computer".
Moreover, I also followed the instruction from the page, tried the command line "netstat -ano | findstr 1801". But nothing happened, I mean really "nothing" happened at all. Shouldnt there be some output in the prompt window?
Now, I am not even sure if the MSMQ is working on my computer. I only have the "Reliable Multicast Protocol" installed via the property window of the network adapter. Is there anything missing?
-
Monday, July 30, 2012 9:22 AMcould anyone help?


