~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/smart.py

  • Committer: Andrew Bennetts
  • Date: 2006-08-10 01:52:46 UTC
  • mto: (2018.5.1 split-smart)
  • mto: This revision was merged to the branch mainline in revision 2435.
  • Revision ID: andrew.bennetts@canonical.com-20060810015246-f155b70b3aecb0c4
Flesh out more Remote* methods needed to open and initialise remote branches/trees/repositories.

Show diffs side-by-side

added added

removed removed

Lines of Context:
436
436
 
437
437
    def accept_and_serve(self):
438
438
        conn, client_addr = self._server_socket.accept()
 
439
        conn.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
439
440
        from_client = conn.makefile('r')
440
441
        to_client = conn.makefile('w')
441
442
        handler = SmartStreamServer(from_client, to_client,
542
543
        """Smart server transport can do read/write file operations."""
543
544
        return False
544
545
                                                   
545
 
    def get_smart_client(self):                    
546
 
        return self._client                        
 
546
    def get_smart_client(self):
 
547
        return self._client
547
548
                                                   
548
 
    def _unparse_url(self, path):                  
549
 
        """Return URL for a path.                 l
 
549
    def _unparse_url(self, path):
 
550
        """Return URL for a path.
550
551
 
551
552
        :see: SFTPUrlHandling._unparse_url
552
553
        """
583
584
        
584
585
        :see: Transport.get()
585
586
        """
586
 
        mutter("%s.get %s", self, relpath)
 
587
        ## mutter("%s.get %s", self, relpath)
587
588
        remote = self._remote_path(relpath)
588
 
        mutter("  remote path: %s", remote)
 
589
        ## mutter("  remote path: %s", remote)
589
590
        resp = self._client._call('get', remote)
590
591
        if resp != ('ok', ):
591
592
            self._translate_error(resp)
772
773
 
773
774
    def _connect_to_server(self):
774
775
        self._socket = socket.socket()
 
776
        self._socket.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
775
777
        result = self._socket.connect_ex((self._host, int(self._port)))
776
778
        if result:
777
779
            raise errors.ConnectionError("failed to connect to %s:%d: %s" %