Re: SLP in MFC

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



(I don't anything about the SLP protocal.) But as far as the multicast
socket goes, you will also have to use SetSocketOpt to join the multicast
group.

Something like this
BOOL LSSocket::CreateReceivingMulticastSocket(LPCTSTR strGroupIP, UINT
nGroupPort,DWORD &Error)
{
/* Create socket for receiving packets from multicast group */
if(!CAsyncSocket::Create(nGroupPort, SOCK_DGRAM,FD_READ))
{
Error = GetLastError();
return FALSE;
}

m_UDP = TRUE;

BOOL bMultipleApps = TRUE; /* allow reuse of local port if needed */
SetSockOpt(SO_REUSEADDR, (void*)&bMultipleApps, sizeof(BOOL),
SOL_SOCKET);

/* Join the multicast group */
m_mrMReq.imr_multiaddr.s_addr = inet_addr(strGroupIP); /* group addr */
m_mrMReq.imr_interface.s_addr = htons(INADDR_ANY); /* use default */
setsockopt(m_hSocket, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char FAR
*)&m_mrMReq, sizeof(m_mrMReq));
return TRUE;
}


AliR.


"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:8u87h3paloji1p3uhcj296gia0ai4d4s7f@xxxxxxxxxx
Thanks for the pointer. According to the page
http://www.openslp.org/doc/rfc/rfc2608.txt
section 6.1, it appears that SLP can run over UDP or TCP, and as UDP then
it would (and
servers are expected to) support UDP Multicast. So it is a layer built on
top of both UDP
and TCP/IP. The issue being that if a packet would exceed the maximum UDP
packet size,
then a TCP connection has to be established, but this is apparently
detectable because an
"overflow" bit is set for the response. So the bottom line is that using
CAsyncSocket
with a UDP connection should satisfy the requirments of multicasting, at
least as far as I
have been able to infer in a quick read of the material.
joe

On Mon, 15 Oct 2007 10:33:48 -0500, "AliR \(VC++ MVP\)"
<AliR@xxxxxxxxxxxxx> wrote:

http://www.openslp.org/doc/html/IntroductionToSLP/index.html


"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:50p6h3tujl6tdlojtdspk6mmj2nfriefih@xxxxxxxxxx
If I knew what SLP was, I might have a chance to answer the question.
Is
it some protocol
implemented using UDP? If it involves UDP, I'd use CAsyncSocket. If
not,
since I don't
recognize the acronym, I'm otherwise at a loss.
joe

On Sun, 14 Oct 2007 21:43:51 -0700, "doublemaster007@xxxxxxxxx"
<doublemaster007@xxxxxxxxx> wrote:

Hi all,

Could any one please explain me how to multicast SLP packet in MFC? Is
there any sample code for this?

Nas
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm


.



Relevant Pages

  • Re: help/advice regarding multicasting
    ... inbuilt in TCP so there is no need to add application level facility in it. ... packet at the end, a lot of system services used UDP and that work for LAN ... Now one way to do it is by multicast. ...
    (microsoft.public.win32.programmer.networks)
  • Re: help/advice regarding multicasting
    ... packet at the end, a lot of system services used UDP and that work for LAN ... I am developing a P2P system for distributing files in the ... Now one way to do it is by multicast. ...
    (microsoft.public.win32.programmer.networks)
  • Re: help/advice regarding multicasting
    ... But that in TCP, and if you want it in UDP you have to add reliability to ... Now one way to do it is by multicast. ... packet and all the PC's that will catch that packet will join the ...
    (microsoft.public.win32.programmer.networks)
  • receiving mjpegs over tcp and multicasting decoded rgb images slows network down?
    ... jpegs as rgb images via udp into the local network. ... udp multicast socket. ...
    (comp.os.linux.networking)
  • Re: help/advice regarding multicasting
    ... IMHO you can use UDP only too, ... For packet drops you can ... I am developing a P2P system for distributing files in the ... Now one way to do it is by multicast. ...
    (microsoft.public.win32.programmer.networks)