def sendRequest(self, channel, requestType, data, wantReply=0):
        """
        Send a request to a channel.

        @type channel:      subclass of C{SSHChannel}
        @type requestType:  L{bytes}
        @type data:         L{bytes}
        @type wantReply:    L{bool}
        @rtype              C{Deferred}/L{None}
        """
        if channel.localClosed:
            return
        log.msg('sending request %r' % (requestType))
        self.transport.sendPacket(MSG_CHANNEL_REQUEST, struct.pack('>L',
                                    self.channelsToRemoteChannel[channel])
                                  + common.NS(requestType)+chr(wantReply)
                                  + data)
        if wantReply:
            d = defer.Deferred()
            self.deferreds.setdefault(channel.id, []).append(d)
            return d

        Send a request to a channel.

        @type channel:      subclass of C{SSHChannel}
        @type requestType:  L{bytes}
        @type data:         L{bytes}
        @type wantReply:    L{bool}
        @rtype              C{Deferred}/L{None}
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/ssh/connection.py