X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FIOEvent.cc;h=abb197496ffb50a6d856b5a5a30c1a45ee3e47ef;hb=d04ae6002c7fa6eccaa2acdfb49b16cccdb81845;hp=2010b6bfc92233090e2b095348569010e49c729b;hpb=81ffa1c459b96dd44472bcef37e1e373934ee138;p=senf.git diff --git a/PPI/IOEvent.cc b/PPI/IOEvent.cc index 2010b6b..abb1974 100644 --- a/PPI/IOEvent.cc +++ b/PPI/IOEvent.cc @@ -1,8 +1,8 @@ // $Id$ // // Copyright (C) 2007 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY // Stefan Bund // // This program is free software; you can redistribute it and/or modify @@ -41,7 +41,7 @@ prefix_ void senf::ppi::IOEvent::v_enable() { - Scheduler::instance().add(fd_, boost::bind(&IOEvent::cb,this,_1,_2), + Scheduler::instance().add(fd_, boost::bind(&IOEvent::cb,this,_1), Scheduler::EventId(events_)); } @@ -50,10 +50,20 @@ prefix_ void senf::ppi::IOEvent::v_disable() Scheduler::instance().remove(fd_, Scheduler::EventId(events_)); } -prefix_ void senf::ppi::IOEvent::cb(int, Scheduler::EventId event) +prefix_ void senf::ppi::IOEvent::cb(Scheduler::EventId event) { - IOEventInfo info = { event }; - callback(info); + if ((event & ~events_) != 0) { + if (event & Err) + throw ErrorException(); + else if (event & Hup) + throw HangupException(); + else + // This cannot happen. + BOOST_ASSERT(false); + } else { + IOEventInfo info = { event }; + callback(info); + } } ///////////////////////////////cc.e////////////////////////////////////////