/*
 * (c) 2005 Research Group Dr. Fuhrmann, University of Karlsruhe, Germany
 * All rights reserved.
 *
 * Author:
 *         Stefan Denk <denk@ira.uka.de>
 *         Kendy Kutzner <kutzner@ira.uka.de>
 *
 * $Id: igorinterface.cc,v 1.4 2006/01/05 10:31:44 denk Exp $
 *
 */

#include "igorinterface.h"
#include "vtmsg.h"

void
igorinterface::Action(){
	//dsyslog("%s: begin", __PRETTY_FUNCTION__);
	char * buf;
	size_t len;
	while (true){
		vtmsg *m = new vtmsg;
		buf = NULL;
		// the blocking call
		// XXX int res = 
		igor_recvfromto(*_s, (void**)&buf, &len, &(m->upcall), &(m->hdst), &(m->src));
		///\bug check result!
		m->fromstring(buf, len);
		_q->Lock();
		_q->push_back(m);
		_q->Unlock();
		_w->Signal();
	}
}

