From 971d1fdf8599dccdc604ed9374373af16af8354f Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 27 Oct 2005 14:08:28 +0000 Subject: *** empty log message *** --- src/multicast.cc | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/multicast.cc') diff --git a/src/multicast.cc b/src/multicast.cc index ff3f557..0072c19 100644 --- a/src/multicast.cc +++ b/src/multicast.cc @@ -27,6 +27,8 @@ #include "config.h" #include "multicast.h" +#include "multicast_configuration.h" + #include "miav_config.h" #include @@ -44,13 +46,18 @@ #include -Multicast::Multicast(Info *i, char *addr, int port) +Multicast::Multicast(Info *i, mcastconf_t &mcclientconf) { info = i; udp_buffer = NULL; - + + multicast_audio = mcclientconf.with_audio; + // Open connection socket - if(!UDPOpen(addr, port)) info->error("Error creating socket %s:%d", addr, port); + if(!UDPOpen(mcclientconf.addr.c_str(), mcclientconf.port)) + info->error("Error creating socket %s:%d", + mcclientconf.addr.c_str(), + mcclientconf.port); int mtu = config->readInt("udp_packet_size"); @@ -75,9 +82,9 @@ Multicast::~Multicast() if(udp_buffer) delete udp_buffer; } -void Multicast::Write(void* buf, int size) +int Multicast::Write(void* buf, int size) { - if(!udp_buffer) return; // no buffer to write in... better break out! + if(!udp_buffer) return 0; // no buffer to write in... better break out! // info->info("To send: %d", size); @@ -104,6 +111,7 @@ void Multicast::Write(void* buf, int size) udp_buffer_pointer = udp_buffer; } } + return size; } bool Multicast::is_address_multicast(unsigned long address) @@ -119,7 +127,7 @@ bool Multicast::is_address_multicast(unsigned long address) /* * open UDP socket */ -bool Multicast::UDPOpen(char *address, int port) +bool Multicast::UDPOpen(const char *address, int port) { int enable = 1L; struct sockaddr_in stAddr; -- cgit v1.2.3