示例#1
0
    def lineReceived(self, line):
       # Pass through end of header
       if not line:
           QueryProtocol.lineReceived(self, line)
           return

       # seperate with any single valid EOL combination.
       # '\n\n' becomes ['','']
       lines = line.splitlines()

       # Pass one at a time until we pass the header
       while self.line_mode and len(lines):
           line = lines.pop(0)
           QueryProtocol.lineReceived(self, line)

       # Any remaining lines are really part of the body
       # join with arbitrary EOL since XML parser should
       # be able to handle it.
       if len(lines):
           self.rawDataReceived('\n\r'.join(lines))
示例#2
0
 def handleResponseEnd(self):
     QueryProtocol.handleResponseEnd(self)
     self.setTimeout(None)
     self.transport.loseConnection()
示例#3
0
 def connectionLost(self, reason):
     self.setTimeout(None)
     QueryProtocol.connectionLost(self, reason)
示例#4
0
 def connectionMade(self):
     QueryProtocol.connectionMade(self)
     if self.factory.rpc_timeout:
         self.setTimeout(self.factory.rpc_timeout.get())
示例#5
0
 def handleResponseEnd(self):
     QueryProtocol.handleResponseEnd(self)
     self.setTimeout(None)
     self.transport.loseConnection()
示例#6
0
 def connectionLost(self, reason):
     self.setTimeout(None)
     QueryProtocol.connectionLost(self, reason)
示例#7
0
 def connectionMade(self):
     QueryProtocol.connectionMade(self)
     if self.factory.rpc_timeout:
         self.setTimeout(self.factory.rpc_timeout.get())