Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Network Class Reference

CLASS: Network. More...

#include <net.H>

Inheritance diagram for Network:

Inheritance graph
[legend]
Collaboration diagram for Network:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Network (FD_MANAGER *m)
virtual ~Network ()
void connect_to (NetStream *s)
void start (int port=0)
void start (char *host, int port)
void flush_data ()
void subscribe (Cstr_ptr &tag)
NetStreamoperator[] (int i)
int num_streams (void) const
int port (void) const
Cstr_ptr & name (void) const
int processing (void) const
void barrier ()
void add_net_obs (Network_obs *o)
void rem_net_obs (Network_obs *o)
void notify_net (Network_obs::event e, NetStream *s)
virtual void reset ()
virtual void except ()
int fd ()

Protected Member Functions

virtual void sample ()
virtual void Unregister (NetStream *s)
virtual void Register (NetStream *s)
virtual void Register ()
virtual int interpret (NETenum code, NetStream *sender)=0
virtual void add_client (NetStream *cli)
virtual void remove_stream (NetStream *s)
void _die (const char *msg)
char * configure (int port, int backlog=NETWORK_SERVER_BACKLOG)
void add_stream (NetStream *s)
virtual void accept_stream (void)
NetStreamwait_for_connect ()

Protected Attributes

FD_MANAGER_manager
int nStreams_
NetStreamstreams_ [256]
str_list tags_
int port_
str_ptr name_
int first_
ARRAY< Network_obs * > _obs_list
int _at_barrier
int _fd

Static Private Attributes

static int NETWORK_SERVER_BACKLOG = 5

Friends

class NetStream

Detailed Description

CLASS: Network.

Definition at line 132 of file net.H.


Constructor & Destructor Documentation

Network::Network FD_MANAGER m  )  [inline]
 

Definition at line 165 of file net.H.

virtual Network::~Network  )  [inline, virtual]
 

Definition at line 167 of file net.H.


Member Function Documentation

void Network::_die const char *  msg  )  [protected]
 

Definition at line 1061 of file net.C.

References name_.

Referenced by start(), and wait_for_connect().

void Network::accept_stream void   )  [protected, virtual]
 

Definition at line 1040 of file net.C.

References Network_obs::accept_str, add_client(), add_stream(), NetStream::name(), notify_net(), and wait_for_connect().

Referenced by sample().

void Network::add_client NetStream cli  )  [protected, virtual]
 

Reimplemented in DISTRIB.

Definition at line 1052 of file net.C.

References NETflush, and NETtext.

Referenced by accept_stream().

void Network::add_net_obs Network_obs o  )  [inline]
 

Definition at line 186 of file net.H.

References _obs_list.

void Network::add_stream NetStream s  )  [inline, protected]
 

Definition at line 156 of file net.H.

References nStreams_, Register(), streams_, NetStream::subscribe(), and tags_.

Referenced by accept_stream(), connect_to(), and NetStream::interpret().

void Network::barrier  ) 
 

Definition at line 984 of file net.C.

References _at_barrier, _manager, FD_MANAGER::loop(), NETbarrier, NETflush, nStreams_, and streams_.

char * Network::configure int  port,
int  backlog = NETWORK_SERVER_BACKLOG
[protected]
 

Definition at line 1072 of file net.C.

References FD_EVENT::_fd, int(), name_, net_exception_handler(), NetStream::no_linger(), port_, and Register().

Referenced by start().

void Network::connect_to NetStream s  ) 
 

Definition at line 971 of file net.C.

References add_stream(), FD_EVENT::fd(), Config::get_var_bool(), NETflush, NETidentify, and port_.

Referenced by start().

virtual void FD_EVENT::except  )  [inline, virtual, inherited]
 

Definition at line 47 of file tty.H.

int FD_EVENT::fd  )  [inline, inherited]
 

Definition at line 48 of file tty.H.

References FD_EVENT::_fd.

Referenced by connect_to(), NetStream::interpret(), and WIN_MANAGER::tty_to_id::ready().

void Network::flush_data  ) 
 

Definition at line 1140 of file net.C.

References NetStream::flush_data(), nStreams_, and streams_.

virtual int Network::interpret NETenum  code,
NetStream sender
[protected, pure virtual]
 

Implemented in DISTRIB.

Referenced by NetStream::interpret().

Cstr_ptr& Network::name void   )  const [inline]
 

Definition at line 181 of file net.H.

References name_.

Referenced by DISTRIB::save().

void Network::notify_net Network_obs::event  e,
NetStream s
[inline]
 

Definition at line 188 of file net.H.

References _obs_list, and ARRAY< T >::num().

Referenced by accept_stream(), and remove_stream().

int Network::num_streams void   )  const [inline]
 

Definition at line 179 of file net.H.

References nStreams_.

Referenced by distrib_client(), and operator<<().

NetStream* Network::operator[] int  i  )  [inline]
 

Definition at line 178 of file net.H.

References streams_.

int Network::port void   )  const [inline]
 

Definition at line 180 of file net.H.

References port_.

int Network::processing void   )  const
 

Reimplemented in DISTRIB.

Definition at line 995 of file net.C.

References nStreams_, NetStream::processing(), and streams_.

Referenced by DISTRIB::processing().

virtual void Network::Register  )  [inline, protected, virtual]
 

Definition at line 149 of file net.H.

References _manager, and FD_MANAGER::add().

Referenced by add_stream(), and configure().

virtual void Network::Register NetStream s  )  [inline, protected, virtual]
 

Definition at line 147 of file net.H.

References _manager, FD_MANAGER::add(), and NetStream::add_network().

void Network::rem_net_obs Network_obs o  )  [inline]
 

Definition at line 187 of file net.H.

References _obs_list.

void Network::remove_stream NetStream s  )  [protected, virtual]
 

Reimplemented in DISTRIB.

Definition at line 1023 of file net.C.

References notify_net(), nStreams_, Network_obs::remove_str, streams_, and Unregister().

Referenced by NetStream::interpret(), NetStream::remove_me(), DISTRIB::remove_stream(), and NetStream::sample().

virtual void FD_EVENT::reset  )  [inline, virtual, inherited]
 

Reimplemented in TabletMultimode.

Definition at line 46 of file tty.H.

virtual void Network::sample  )  [inline, protected, virtual]
 

Implements FD_EVENT.

Definition at line 145 of file net.H.

References accept_stream().

void Network::start char *  host,
int  port
[inline]
 

Definition at line 171 of file net.H.

References connect_to(), NetStream, and start().

void Network::start int  port = 0  ) 
 

Definition at line 1124 of file net.C.

References _die(), configure(), and first_.

Referenced by distrib_client(), distrib_startnet(), and start().

void Network::subscribe Cstr_ptr &  tag  )  [inline]
 

Definition at line 175 of file net.H.

References nStreams_, streams_, NetStream::subscribe(), and tags_.

virtual void Network::Unregister NetStream s  )  [inline, protected, virtual]
 

Definition at line 146 of file net.H.

References _manager, and FD_MANAGER::rem().

Referenced by remove_stream().

NetStream * Network::wait_for_connect  )  [protected]
 

Definition at line 1004 of file net.C.

References _die(), FD_EVENT::_fd, and NetStream.

Referenced by accept_stream().


Friends And Related Function Documentation

friend class NetStream [friend]
 

Definition at line 133 of file net.H.

Referenced by start(), and wait_for_connect().


Member Data Documentation

int Network::_at_barrier [protected]
 

Definition at line 162 of file net.H.

Referenced by barrier(), and NetStream::interpret().

int FD_EVENT::_fd [protected, inherited]
 

Definition at line 41 of file tty.H.

Referenced by NetStream::_die(), NetStream::attached(), TTYfd::clear(), TTYfd::close(), configure(), TTYfd::deactivate(), TTYfd::drain(), FD_EVENT::fd(), TTYfd::get_flags(), NetStream::NetStream(), NetStream::no_tcp_delay(), TTYfd::nread(), TTYfd::open(), TTYfd::read_all(), NetStream::read_from_net(), TTYfd::send_break(), NetStream::set_blocking(), TTYfd::set_flags(), TTYfd::setup(), wait_for_connect(), TTYfd::write(), NetStream::write_to_net(), and NetStream::~NetStream().

FD_MANAGER* Network::_manager [protected]
 

Definition at line 137 of file net.H.

Referenced by barrier(), Register(), and Unregister().

ARRAY<Network_obs *> Network::_obs_list [protected]
 

Definition at line 161 of file net.H.

Referenced by add_net_obs(), notify_net(), and rem_net_obs().

int Network::first_ [protected]
 

Definition at line 143 of file net.H.

Referenced by NetStream::interpret(), and start().

str_ptr Network::name_ [protected]
 

Definition at line 142 of file net.H.

Referenced by _die(), configure(), and name().

int Network::NETWORK_SERVER_BACKLOG = 5 [static, private]
 

Definition at line 134 of file net.H.

int Network::nStreams_ [protected]
 

Definition at line 138 of file net.H.

Referenced by add_stream(), barrier(), flush_data(), num_streams(), processing(), remove_stream(), and subscribe().

int Network::port_ [protected]
 

Definition at line 141 of file net.H.

Referenced by configure(), connect_to(), and port().

NetStream* Network::streams_[256] [protected]
 

Definition at line 139 of file net.H.

Referenced by add_stream(), barrier(), flush_data(), NetStream::interpret(), operator[](), processing(), remove_stream(), and subscribe().

str_list Network::tags_ [protected]
 

Definition at line 140 of file net.H.

Referenced by add_stream(), and subscribe().


The documentation for this class was generated from the following files:
Generated on Mon Sep 18 11:46:45 2006 for jot by  doxygen 1.4.4