qmsk/net/transport/client.py
changeset 28 020c89baaa33
child 45 bb49bf8222ed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qmsk/net/transport/client.py	Fri Aug 21 00:30:06 2009 +0300
@@ -0,0 +1,32 @@
+"""
+    Abstract Client interface
+"""
+
+class Client (object) :
+    """
+        A Client establishes a connection to some remote Service.
+        
+        This is an abstract base class that is further impemented by e.g. TCP or SSL.
+
+        Note that a Client behaves more like a factory, such that the Client itself is not a Transport, one must instead
+        call .connect(), rather like one must call Service.accept().
+    """
+
+    def __init__ (self, endpoint) :
+        """
+            Connect to the given remote endpoint.
+
+                endpoint        - the remote Endpoint to connect to
+        """
+
+        raise NotImplementedError()
+
+    def connect (self, cls=None) :
+        """
+            Perform the connect operation, returning a new Transport.
+                
+                cls         - optional transport-specific type to use for the new connection.
+        """
+
+        raise NotImplementedError()
+