Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

mctxhandler.h File Reference


Detailed Description

This is a multicast file sender (tx). Given a file, this handler will broadcast it to the specified multicast address. This is meant to be used with mcrxhandler, the receiver program.

This design is intended to run on LANs and typically used to share files on a cluster/grid.

The design assumes a CLEAN network, where dropped packets are very unusual. Although this program will re-send dropped packets, the performance will be adversley affected. In this design a dropped packet is considered an error. If you do see many dropped packets you can lower the tranmit rate and/or troubleshoot your network.

Wire keywords (standard handler keywords documented in Wire )

Example:
create handler mctx { file: 'mydata.dat' runonce: }

Events accepted:
TypeDescription
String Replace file: with value of event, then send
Any except String Send file

Events generated:
Event NameTypeDescription
sent AW_EVENT_TYPE_STRING Was able to send file, value is file path
error AW_EVENT_TYPE_STRING Was NOT able to send file, value is file path

#include "monitor.h"
#include "wire.h"
#include "mctxrx.h"

Go to the source code of this file.

Data Structures

struct  aw_mctxhandler_events_t
struct  aw_mctxhandler_state_t
 State of handler. More...

struct  aw_mctxhandler_t
 Handler object. More...


Enumerations

enum  aw_mctxhandler_state_cd_t { AW_MCTXHANDLER_IDLE, AW_MCTXHANDLER_WRITING, AW_MCTXHANDLER_WAIT_RETX }
 The state codes for each state on handler. More...


Functions

aw_mctxhandler_t * aw_create_mctxhandler (const byte_t *filename, u_int32_t rate, u_int32_t messagesize, const byte_t *mcaddress, u_int32_t mcport, const byte_t *mcinterface, u_int32_t mcloopback, u_int32_t retxport, aw_timestamp_t timeout, const aw_mctxhandler_events_t *events, int32_t(*regevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index), int32_t(*regmaskevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index), const aw_alarm_sched_t *sched, aw_logger_t *logger)
 Create a mctxhandler.


Enumeration Type Documentation

enum aw_mctxhandler_state_cd_t
 

The state codes for each state on handler.

Enumeration values:
AW_MCTXHANDLER_IDLE  not doing anything
AW_MCTXHANDLER_WRITING  writing file to mcaddress
AW_MCTXHANDLER_WAIT_RETX  waiting for request for re transmits


Function Documentation

aw_mctxhandler_t* aw_create_mctxhandler (  const byte_t *  filename,
u_int32_t  rate,
u_int32_t  messagesize,
const byte_t *  mcaddress,
u_int32_t  mcport,
const byte_t *  mcinterface,
u_int32_t  mcloopback,
u_int32_t  retxport,
aw_timestamp_t  timeout,
const aw_mctxhandler_events_t *  events,
int32_t(*  regevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index),
int32_t(*  regmaskevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index),
const aw_alarm_sched_t *  sched,
aw_logger_t *  logger
) 
 

Create a mctxhandler.

aw_create_mctxhandler

Parameters:
filename File to send
rate The maximum transmit rate as megabits/sec
messagesize The size of muticast message
mcaddress Multicast address
mcport Multicast port
mcinterface Interface name to send multicast, may be NULL to default
mcloopback If nonzero, then enable multicast to current machine. If zero, then do not.
retxport Port to listen for retransmit requests
timeout Time to wait idle after sending file for client re-transmit requests
events Events to send for each file
sched Run schedule
regevent Function pointer for event registration
regmaskevent Function pointer for event mask registration
logger Logger object
Returns:
Handler object

Aware 0.11.1 Copyright (C) 1998-2005 Russell Leighton (russ@elegant-software.com)