'Send stream level error.
If we are the receiving entity, and haven\'t sent the header yet,
we sent one first.
After sending the stream error, the stream is closed and the transport
connection dropped.
@param streamError: stream error instance
@type streamError: L{error.StreamError}'

def sendStreamError(self, streamError):

    if ((not self._headerSent) and (not self.initiating)):
        self.sendHeader()
    if self._headerSent:
        self.send(streamError.getElement())
        self.sendFooter()
    self.transport.loseConnection()
