/[ambar]/ambar/connection.py
ViewVC logotype

Diff of /ambar/connection.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2.3 by pabloruiz, Tue Nov 5 22:58:22 2002 UTC revision 2.4 by amoyav, Sat Dec 7 23:09:35 2002 UTC
# Line 32  from socket import * Line 32  from socket import *
32  from select import *  from select import *
33  from string import *  from string import *
34    
35  class Connection:  class Connection(object):
36      """An accepted connection.      """An accepted connection.
37    
38      It allows to send and receive lines of text messages from a client.      It allows to send and receive lines of text messages from a client.
# Line 253  class Connection: Line 253  class Connection:
253          self.dataqueue = ""          self.dataqueue = ""
254    
255    
256  class ConnectionHandler:  class ConnectionHandler(object):
257      """A server that listens to a TCP port and accepts connection      """A server that listens to a TCP port and accepts connection
258      requests from clients.      requests from clients.
259    
# Line 346  if (__name__ == '__main__'): Line 346  if (__name__ == '__main__'):
346            
347      clients = []      clients = []
348    
349      class Client:      class Client(object):
350          def data_received(self, conn):          def data_received(self, conn):
351              print "Received message from " + conn.ip + ":", conn.receive(),              print "Received message from " + conn.ip + ":", conn.receive(),
352              if conn.receive() == "quit\n":              if conn.receive() == "quit\n":

Legend:
Removed from v.2.3  
changed lines
  Added in v.2.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26