'Write 60 lines of data to the transport, then exit.'

def openShell(self, transport):

    proto = protocol.Protocol()
    proto.makeConnection(transport)
    transport.makeConnection(wrapProtocol(proto))
    def write(counter):
        i = next(counter)
        if (i == 60):
            call.stop()
            transport.session.conn.sendRequest(transport.session, 'exit-status', '\x00\x00\x00\x00')
            transport.loseConnection()
        else:
            line = ('line    #%02d\n' % (i,))
            line = line.encode('utf-8')
            transport.write(line)
    call = LoopingCall(write, count())
    call.start(0.01)
