summaryrefslogtreecommitdiff
path: root/server/multicast.cc
diff options
context:
space:
mode:
authordeva <deva>2006-07-20 17:53:17 +0000
committerdeva <deva>2006-07-20 17:53:17 +0000
commit7d39c063ea84b9b30dbe669ac4ae641a49506836 (patch)
treeef1ead10d1736e9ad7ffe139872c86fd2ee00901 /server/multicast.cc
parentc8df40b62cf30029a4acd1a57c8c54add54dda9b (diff)
Utilized the global info object.
Utilized the global info object. Utilized the global info object.
Diffstat (limited to 'server/multicast.cc')
-rw-r--r--server/multicast.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/server/multicast.cc b/server/multicast.cc
index dd12c27..2bb6df1 100644
--- a/server/multicast.cc
+++ b/server/multicast.cc
@@ -30,6 +30,7 @@
#include "multicast_configuration.h"
#include "miav_config.h"
+#include "info.h"
#include <sys/socket.h>
#include <netinet/in.h>
@@ -46,16 +47,15 @@
#include <errno.h>
-Multicast::Multicast(Info *i, mcastconf_t &mcclientconf)
+Multicast::Multicast(mcastconf_t &mcclientconf)
{
- info = i;
udp_buffer = NULL;
multicast_audio = mcclientconf.with_audio;
// Open connection socket
if(!UDPOpen(mcclientconf.addr.c_str(), mcclientconf.port))
- info->error("Error creating socket %s:%d",
+ MIaV::info->error("Error creating socket %s:%d",
mcclientconf.addr.c_str(),
mcclientconf.port);
@@ -69,10 +69,10 @@ Multicast::Multicast(Info *i, mcastconf_t &mcclientconf)
if(udp_buffer_size < 1) udp_buffer_size = 1;
udp_buffer = new char[udp_buffer_size];
udp_buffer_pointer = udp_buffer;
- info->info("UDP packet buffer size %db", udp_buffer_size);
+ MIaV::info->info("UDP packet buffer size %db", udp_buffer_size);
//} else {
- // info->error("Error getting MTU size from socket: %s", strerror(errno));
+ // MIaV::info->error("Error getting MTU size from socket: %s", strerror(errno));
// return;
//}
}
@@ -86,7 +86,7 @@ int Multicast::Write(void* buf, int size)
{
if(!udp_buffer) return 0; // no buffer to write in... better break out!
- // info->info("To send: %d", size);
+ // MIaV::info->info("To send: %d", size);
char *p = (char*)buf;
int left = udp_buffer_size - (udp_buffer_pointer - udp_buffer);
@@ -102,10 +102,10 @@ int Multicast::Write(void* buf, int size)
p+=to_copy;
size-=to_copy;
- // info->info("Copied %d - %d to go", to_copy, size);
+ // MIaV::info->info("Copied %d - %d to go", to_copy, size);
if(left == 0) {
- // info->info("Sending full packet");
+ // MIaV::info->info("Sending full packet");
write(sock, udp_buffer, udp_buffer_size);
left = udp_buffer_size;
udp_buffer_pointer = udp_buffer;
@@ -117,10 +117,10 @@ int Multicast::Write(void* buf, int size)
bool Multicast::is_address_multicast(unsigned long address)
{
if((address & 255) >= 224 && (address & 255) <= 239) {
- info->info("Address is multicast.");
+ MIaV::info->info("Address is multicast.");
return true;
}
- info->info("Address is NOT multicast.");
+ MIaV::info->info("Address is NOT multicast.");
return false;
}