Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
dispatcher Class Reference
Inheritance diagram for dispatcher:
async_chat dispatcher_with_send file_dispatcher SMTPServer SMTPChannel DebuggingServer PureProxy MailmanProxy

Public Member Functions

def __init__
 
def __repr__
 
def add_channel
 
def del_channel
 
def create_socket
 
def set_socket
 

Data Fields

 connected
 
 socket
 
 family_and_type
 

Static Public Attributes

int debug = 0
 
int connected = 0
 
int accepting = 0
 
int closing = 0
 
 addr = None
 

Detailed Description

Definition at line 203 of file asyncore.py.

Constructor & Destructor Documentation

def __init__ (   self,
  sock = None,
  map = None 
)

Definition at line 210 of file asyncore.py.

References dispatcher.set_socket().

211  def __init__ (self, sock=None, map=None):
212  if sock:
213  self.set_socket (sock, map)
214  # I think it should inherit this anyway
215  self.socket.setblocking (0)
216  self.connected = 1
217  # XXX Does the constructor require that the socket passed
218  # be connected?
219  try:
220  self.addr = sock.getpeername()
221  except socket.error:
222  # The addr isn't crucial
223  pass
224  else:
225  self.socket = None

Member Function Documentation

def __repr__ (   self)

Definition at line 226 of file asyncore.py.

References dispatcher.accepting, dispatcher.addr, and dispatcher.connected.

227  def __repr__ (self):
228  status = [self.__class__.__module__+"."+self.__class__.__name__]
229  if self.accepting and self.addr:
230  status.append ('listening')
231  elif self.connected:
232  status.append ('connected')
233  if self.addr is not None:
234  try:
235  status.append ('%s:%d' % self.addr)
236  except TypeError:
237  status.append (repr(self.addr))
238  return '<%s at %#x>' % (' '.join (status), id (self))
def add_channel (   self,
  map = None 
)

Definition at line 239 of file asyncore.py.

References dispatcher._fileno.

240  def add_channel (self, map=None):
241  #self.log_info ('adding channel %s' % self)
242  if map is None:
243  map=socket_map
244  map [self._fileno] = self
def create_socket (   self,
  family,
  type 
)

Definition at line 253 of file asyncore.py.

254  def create_socket (self, family, type):
255  self.family_and_type = family, type
256  self.socket = socket.socket (family, type)
257  self.socket.setblocking(0)
258  self._fileno = self.socket.fileno()
259  self.add_channel()
def del_channel (   self,
  map = None 
)

Definition at line 245 of file asyncore.py.

References dispatcher._fileno.

246  def del_channel (self, map=None):
247  fd = self._fileno
248  if map is None:
249  map=socket_map
250  if map.has_key (fd):
251  #self.log_info ('closing channel %d:%s' % (fd, self))
252  del map [fd]
def set_socket (   self,
  sock,
  map = None 
)

Definition at line 260 of file asyncore.py.

References dispatcher._fileno, dispatcher.add_channel(), and dispatcher.socket.

261  def set_socket (self, sock, map=None):
self.socket = sock

Field Documentation

int accepting = 0
static

Definition at line 206 of file asyncore.py.

addr = None
static

Definition at line 208 of file asyncore.py.

int closing = 0
static

Definition at line 207 of file asyncore.py.

int connected = 0
static

Definition at line 205 of file asyncore.py.

connected

Definition at line 215 of file asyncore.py.

int debug = 0
static

Definition at line 204 of file asyncore.py.

family_and_type

Definition at line 254 of file asyncore.py.

socket

Definition at line 224 of file asyncore.py.


The documentation for this class was generated from the following file: