Revision a5fdfbae src/connection.cpp

View differences:

src/connection.cpp
38 38
  : dataFD(dataFD), priority(0), 
39 39
    tuned(false), retuning(false), 
40 40
    tm(tm), removeMe(false),
41
    stopTime(0),
42 41
    interrupted(false), 
43 42
    lostPacket(false),
44 43
    convertToPS(false),
......
100 99
void Connection::addSelectFDs(Select &s) const
101 100
{
102 101
  dataOutput->addSelectFDs(s);
103

  
104
  if (stopTime != 0)
105
    s.addAlarm(std::max(0L, stopTime - getCurrentTime()), 0);
106 102
}
107 103

  
108 104
bool Connection::isReady(const Select &s) const
......
123 119
  priority = p;
124 120
}
125 121

  
126
void Connection::setStopTime(time_t newStopTime)
127
{
128
  stopTime = newStopTime;
129
}
130

  
131
time_t Connection::getStopTime() const
132
{
133
  return stopTime;
134
}
135

  
136 122
bool Connection::isValidType(const std::string &type ) const
137 123
{
138 124
  return tm->validType(type);
......
225 211

  
226 212
bool Connection::processReady(const Select &s)
227 213
{
228
  if (stopTime != 0 && getCurrentTime() > stopTime) {
229
    if (debugLevel > 0) {
230
      std::cerr << "Stop time reached (stopTime = " << stopTime 
231
		<< ", now = " << getCurrentTime() << ")\n";
232
    }
233
    return false;
234
  }
235

  
236 214
  if (removeMe)
237 215
    return false;
238 216

  
......
272 250

  
273 251
std::ostream& Connection::printOn(std::ostream &o) const
274 252
{
253
  o << getType() << " ";
275 254
  if (!tuned) 
276 255
    return o << "UNTUNED";
277 256
  else

Also available in: Unified diff