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.
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));
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?