fixbot/api/amp.py
author Tero Marttila <terom@fixme.fi>
Sat, 20 Feb 2010 23:06:43 +0200
changeset 64 8574aeff9b36
parent 62 e4db89a5f6bc
permissions -rw-r--r--
blind error handling tweaks
62
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     1
from twisted.protocols import amp
64
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
     2
from twisted.python import log
62
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     3
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     4
from fixbot.module import ModuleInfo, Event
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     5
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     6
class CmdModuleRegister (amp.Command) :
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     7
    """
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     8
        Register module
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     9
    """
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    10
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    11
    arguments = [
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    12
        ('name',    amp.String()),
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    13
    ]
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    14
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    15
class CmdModuleEvent (amp.Command) :
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    16
    """
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    17
        Broadcast event
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    18
    """
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    19
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    20
    arguments = [
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    21
        ('type',    amp.String()),
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    22
        ('msg',     amp.String()),
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    23
    ]
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    24
64
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    25
class CmdModuleAbort (amp.Command) :
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    26
    """
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    27
        Module has failed and will now disconnect
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    28
    """
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    29
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    30
    arguments = [
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    31
        ('msg',     amp.String())   # string describing the error occuring
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    32
    ]
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    33
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    34
    requiresAnswer = False
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    35
62
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    36
class ServerProtocol (amp.AMP) :
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    37
    """
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    38
        Nexus-side command handler
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    39
    """
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    40
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    41
    # the registered ModuleInfo
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    42
    module = None
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    43
    
64
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    44
    def connectionMade (self) :
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    45
        log.msg("Module connecting from: %s" % (self.transport.getPeer()))
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    46
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    47
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    48
    def connectionLost (self, reason) :
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    49
        log.err(reason, "Module lost")
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    50
        
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    51
        if self.module :
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    52
            # drop it
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    53
            self.factory.nexus.unregisterModule(self.module, reason.getErrorMessage())
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    54
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    55
62
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    56
    @CmdModuleRegister.responder
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    57
    def on_ModuleRegister (self, name) :
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    58
        # construct the ModuleInfo
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    59
        mi = ModuleInfo()
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    60
        mi.name = name
64
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    61
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    62
        log.msg("Module registered: %s" % (mi))
62
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    63
        
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    64
        # register
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    65
        self.factory.nexus.registerModule(mi, self)
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    66
        self.module = mi
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    67
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    68
        # ok
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    69
        return {}
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    70
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    71
    @CmdModuleEvent.responder
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    72
    def on_ModuleEvent (self, type, msg) :
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    73
        # as Event
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    74
        e = Event(self.module, type, msg)
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    75
        
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    76
        # publish
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    77
        self.factory.nexus.handleEvent(e)
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    78
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    79
        # ok
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    80
        return {}
64
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    81
    
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    82
    @CmdModuleAbort.responder
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    83
    def on_ModuleAbort (self, msg) :
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    84
        # unhook
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    85
        module = self.module
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    86
        self.module = None
62
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    87
64
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    88
        # report
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    89
        self.factory.nexus.unregisterModule(self.module, msg)
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    90
        
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
    91
        # XXX: stop accepting commands etc?
62
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    92
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    93
class ClientProtocol (amp.AMP) :
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    94
    """
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    95
        Module-side command sender/handler
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    96
    """
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    97
    
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    98
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    99
    def connectionMade (self) :
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   100
        """
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   101
            Connected to nexus, send ModuleRegister
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   102
        """
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   103
        
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   104
        # register
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   105
        self.sendModuleRegister(self.factory.name).addCallback(self._ModuleRegisterOK)
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   106
    
64
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
   107
    def connectionLost (self, reason) :
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
   108
        """
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
   109
            Disconnected from nexus, for whatever reason...
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
   110
        """
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
   111
        
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
   112
        log.err(reason, "API connection lost")
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
   113
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
   114
        # XXX: was this expected? Reconnect?
62
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   115
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   116
    def sendModuleRegister (self, name) :
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   117
        """
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   118
            Register with given module name
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   119
        """
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   120
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   121
        return self.callRemote(CmdModuleRegister, name=name)
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   122
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   123
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   124
    def _ModuleRegisterOK (self, ret) :
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   125
        """
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   126
            Registered with nexus, commence operation
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   127
        """
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   128
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   129
        self.factory._onRegistered(self)
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   130
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   131
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   132
    def sendEvent (self, event) :
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   133
        """
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   134
            Broadcast event to nexus
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   135
        """
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   136
        
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   137
        self.callRemote(CmdModuleEvent, type=event.type, msg=event.msg)
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   138
64
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
   139
    def sendModuleAbort (self, msg) :
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
   140
        """
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
   141
            Send CmdModuleAbort - no response is expected
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
   142
        """
62
e4db89a5f6bc restructure api, using AMP as the client-server protocol
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   143
64
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
   144
        self.callRemote(CmdModuleAbort, msg=msg)
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
   145
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
   146
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
   147
    def abort (self, msg) :
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
   148
        """
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
   149
            Send abort message and drop connection
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
   150
        """
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
   151
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
   152
        # disconnect. This should leave the transport to flush buffers, and then call connectionLost
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
   153
        # should also stop us from sending any more commands
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
   154
        self.transport.loseConnection()
8574aeff9b36 blind error handling tweaks
Tero Marttila <terom@fixme.fi>
parents: 62
diff changeset
   155