|
SASC-NG
DVBSoftCAM
|
Inheritance diagram for cNetWatcher:Public Member Functions | |
| cNetWatcher (void) | |
| ~cNetWatcher () | |
| void | Up (cNetSocket *so) |
| void | Down (cNetSocket *so) |
Protected Member Functions | |
| virtual void | Action (void) |
| cNetWatcher::cNetWatcher | ( | void | ) |
| cNetWatcher::~cNetWatcher | ( | ) |
Definition at line 61 of file network.c.
References cThread::Cancel(), cSimpleListBase::Del(), cSimpleList< T >::First(), cThread::Lock(), and cThread::Unlock().
| void cNetWatcher::Action | ( | void | ) | [protected, virtual] |
A derived cThread class must implement the code it wants to execute as a separate thread in this function. If this is a loop, it must check Running() repeatedly to see whether it's time to stop.
Implements cThread.
Definition at line 85 of file network.c.
References cSimpleList< T >::First(), L_CORE_NET, cMutex::Lock(), cThread::Lock(), cSimpleList< T >::Next(), PRINTF, cThread::Running(), and cThread::Unlock().
{
while(Running()) {
sleep(1);
Lock();
for(cNetSocket *so=socks.First(); so;) {
cNetSocket *next=socks.Next(so);
so->Lock();
if(so->connected && so->activity.TimedOut()) {
PRINTF(L_CORE_NET,"idle timeout, disconnected %s:%d",so->hostname,so->port);
so->Disconnect();
}
so->Unlock();
so=next;
}
Unlock();
}
}
| void cNetWatcher::Down | ( | cNetSocket * | so | ) |
Definition at line 78 of file network.c.
References cSimpleListBase::Del(), cThread::Lock(), and cThread::Unlock().
Referenced by cNetSocket::Disconnect().
| void cNetWatcher::Up | ( | cNetSocket * | so | ) |
Definition at line 70 of file network.c.
References cThread::Active(), cSimpleListBase::Add(), cThread::Lock(), cThread::Start(), and cThread::Unlock().
Referenced by cNetSocket::Bind(), and cNetSocket::Connect().