Back to index

texmacs  1.0.7.15
Classes | Functions
socket_notifier.hpp File Reference
#include "basic.hpp"
#include "hashset.hpp"
#include "command.hpp"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  socket_notifier_rep
class  socket_notifier

Functions

 CONCRETE_NULL_CODE (socket_notifier)
tm_ostreamoperator<< (tm_ostream &out, socket_notifier sn)
void perform_select ()
void add_notifier (socket_notifier)
void remove_notifier (socket_notifier)

Function Documentation

Definition at line 36 of file socket_notifier.cpp.

                                   {
  //cout << "enable notifier " << LF;
  notifiers->insert (sn);
#ifdef QTTEXMACS
  the_gui->add_notifier (sn);
#endif
} 

Here is the caller graph for this function:

tm_ostream& operator<< ( tm_ostream out,
socket_notifier  sn 
) [inline]

Definition at line 41 of file socket_notifier.hpp.

                                                                     {
  if (is_nil (sn)) return out << "nil socket_notifier";
else return out << "some socket_notifier"; }

Here is the call graph for this function:

void perform_select ( )

Definition at line 54 of file socket_notifier.cpp.

                  {
#ifndef __MINGW32__
  //FIXME: this can be optimizied
  while (true) {
    fd_set rfds;
    FD_ZERO (&rfds);
    int max_fd= 0;
    iterator<socket_notifier> it = iterate (notifiers);
    while (it->busy ()) {
      socket_notifier sn= it->next ();
      FD_SET (sn->fd, &rfds);
      if (sn->fd >= max_fd) max_fd= sn->fd+1;
    }
    if (max_fd == 0) break;
    
    struct timeval tv;
    tv.tv_sec  = 0;
    tv.tv_usec = 0;
    int nr = select (max_fd, &rfds, NULL, NULL, &tv);
    if (nr==0) break;
    
    it = iterate (notifiers);
    while (it->busy ()) {
      socket_notifier sn=  it->next ();
      if (FD_ISSET (sn->fd, &rfds)) sn->notify ();
    }
  }  
#endif  
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 45 of file socket_notifier.cpp.

                                      {
  //cout << "disable notifier " << LF;
  notifiers->remove (sn);
#ifdef QTTEXMACS
  the_gui->remove_notifier (sn);
#endif
}

Here is the caller graph for this function: