Networking Forums

Networking Forums > Computer Networking > Linux Networking > Multicast client RHL 8 C code

Reply
Thread Tools Display Modes

Multicast client RHL 8 C code

 
 
Greg
Guest
Posts: n/a

 
      08-13-2003, 05:52 AM
I'm trying to write a multicast client in C to run on RHL 8. The goal
is to connect to a microsoft media server on a small lan. I've tried to
write a simple test program, but it never sees any packets. We have a
windows system that is receiving the stream, so it is present on the
network.

The test program takes the port & ip address of the multicast server
from the command line (code is below)
It doesn't work. Any ideas? (ifconfig shows MULTICAST, do I need to do
anything else to enable it?) I also tried a version with connect &
read; same results - they just sit waiting for packets)


if (!inet_aton(argv[1], &name.sin_addr))
{
printf("Invalid host address\n");
return(-1);
}
/* ------------------ */
/* init output socket */
/* ------------------ */
sock = socket(PF_INET, SOCK_DGRAM, 0);
if (sock < 0)
{
printf("Socket open failure\n");
return;
}
name.sin_family = PF_INET;
name.sin_port = htons(port);
i=SO_REUSEADDR;
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &i, sizeof(i)))
{
perror("Could not create socket options: setsockopt()");
return 0;
}
if (bind(sock, (struct sockaddr *)&name, sizeof(name)))
{
perror("binding datagram socket");
return(-1);
}
printf("Waiting for data...\n");
for ( ; 1 ; )
{
i = sizeof(name);
if ((n = recvfrom(sock, &sockbuf[0], sizeof(sockbuf), 0,
(struct sockaddr *)&name, &i)) < 0)
perror("recvfrom() failed. ");
printf("read %i bytes\n", n);
}
close(sock);
}

 
Reply With Quote
 
 
 
 
pbs
Guest
Posts: n/a

 
      08-14-2003, 04:46 AM
Greg wrote:
> I'm trying to write a multicast client in C to run on RHL 8. The goal

[snip]

There is too much to fix in a post and your email address does not work.
Do a google search of "groups" with the search line
"Re: multicast 6060"
There is an example posted back 2nd Sep 1995 which will help you.

 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
client Windows, Server DHCP Linux and option User Class Information(code 77) [HELP] Tyy Linux Networking 0 09-24-2007 11:29 AM
ntp multicast client paddy carroll Windows Networking 2 03-12-2007 02:30 PM
Can Microsoft's RRAS be configured for multicast? Such as in cases where you want to make it a multicast rendevous point? Spin Windows Networking 0 10-26-2006 01:06 PM
Anyone have a rudimentary NFS Windows client code? Dan Linux Networking 3 10-30-2004 08:47 PM
Multicast Catalin Porancea Windows Networking 1 11-18-2003 05:20 PM



1 2 3 4 5 6 7 8 9 10 11