#include "../h/rci.h"

#define BUFSIZE 256

taskFxn(td, arg)
RCI_DESC *td;
int arg;
{
	char buf[BUFSIZE];
	int size;
	RCI_DESC *td1, *td2;

	td1 = rciDescriptor ("task1");
	td2 = rciDescriptor ("task2");

	if (getCurrentTask() == td1)
	 {
	   if (size = rciReceive (0x1, buf, BUFSIZE, NULL))
	    { rciSend (TASKMASK(td2), buf, size);
	    }
	 }
	else
	 { 
	   if (size = rciReceive (TASKMASK(td1), buf, BUFSIZE, NULL))
	    { rciSend (0x1, buf, size);
	    }
	 }
}
