The use of these two classes is simple.
On the Server Site:
Step1: Instantiate a QUANTAnet_fecServer_c object.
Step2: Setup the required parameters by using
void init(unsigned int numSourcePack, unsigned int numTotalPack, unsigned int payloadSize, unsigned short numRowofRecvBuff, unsigned
short timeOut, unsigned short srcPort, unsigned short fecPort)
numSourcePack: number of source packets in the block
numTotalPack: number of packets (including source packets and FEC
packets) in the block
payloadSize: size of payload
numRowofRecvBuff: number of rows of receiving buffer
timeout: timeout value (s)
srcPort: source port number
fecPort: FEC port number
For an example:
init(3,4,1024,5,50,7000,7001) means:
One redundant data packet will be generated from every 3 original source
data packets. The packet size is 1024 Bytes.
Please note: for every data packet to be sent, the size MUST be 1024. So
it's a requirement for users that the data must be done with size of
1024B before sending.
The row size of the receiving buffer array is 5.
7000 UDP port will be used as transmitting original data packets.
7001 UDP port will be used for FEC redundant data packets.
Step3: Receiving data by calling
void streamingRecv(void(* exportFunc)(void*, int))
You have to specify the callbank function exportFunc to let FEC library
to export
the received data to the application.
On the client site:
Step1: Instantiate a QUANTAnet_fecClient_c object.
Step2: Setup those required parameters by using
void init(unsigned int numSourcePack, unsigned int numTotalPack,
unsigned int payloadSize, unsigned short numRowofRecvBuff, char*
host, unsigned short srcPort, unsigned short fecPort)
numSourcePack: number of source packets in the block. Same as server's.
numTotalPack: number of packets (including source packets and FEC
packets) in the block. Same as server's.
payloadSize: size of payload. Same as server's.
host: hostname of server
srcPort: source port number which must be the same as the one set on
the server
fecPort: FEC port number which also is the same as the one set on the server
For an example:
According to the server example above, there will be
init(3,4,1024,"server's name",7000,7001)
Step3: Sending data by calling
void streamingSend(void(*updateFunc)(void*, int))
You need to specify the callback function updateFunc to let application
to fill in the date to send by FEC module.
2. To start the client, type
streamclient <server> <srcport> <fecport> <srcnum> <totalnum> <sendrate> <packetsize>
The streaming client just fills in the whole data block using the sequence number of
the block. When the server receives the block succesfully, it will print out the
sequence number.For example, if you want to stream data from catmull.evl.uic.edu to laurel.evl.uic.edu, type
server 39000 39001 3 4 10 1400
on laurel (In this example, laurel is the server). Then type
streamclient laurel.evl.uic.edu 39000 39001 3 4 5 1400
on catmull.evl.uic.edu.
for more information: Post your questions online on the Quanta forum page.