docs: def handle(self, pkt, raddress, rport):
          """Handle a packet we just received."""
          if not self.context.tidport:
              self.context.tidport = rport
              log.debug("Set remote port for session to %s", rport)
  
          # If we're going to successfully transfer the file, then we should see
          # either an OACK for accepted options, or an ACK to ignore options.
          if isinstance(pkt, TftpPacketOACK):
              log.info("Received OACK from server")
              try:
                  self.handleOACK(pkt)
              except TftpException:
                  log.error("Failed to negotiate options")
                  self.sendError(TftpErrors.FailedNegotiation)
                  raise
              else:
                  log.debug("Sending first DAT packet")
                  self.context.pending_complete = self.sendDAT()
                  log.debug("Changing state to TftpStateExpectACK")
                  return TftpStateExpectACK(self.context)
  
          elif isinstance(pkt, TftpPacketACK):
              log.info("Received ACK from server")
              log.debug("Apparently the server ignored our options")
              # The block number should be zero.
              if pkt.blocknumber == 0:
                  log.debug("Ack blocknumber is zero as expected")
                  log.debug("Sending first DAT packet")
                  self.context.pending_complete = self.sendDAT()
                  log.debug("Changing state to TftpStateExpectACK")
                  return TftpStateExpectACK(self.context)
              else:
                  log.warning("Discarding ACK to block %s" % pkt.blocknumber)
                  log.debug("Still waiting for valid response from server")
                  return self
  
          elif isinstance(pkt, TftpPacketERR):
              self.sendError(TftpErrors.IllegalTftpOp)
              raise TftpException("Received ERR from server: %s" % pkt)
  
          elif isinstance(pkt, TftpPacketRRQ):
              self.sendError(TftpErrors.IllegalTftpOp)
              raise TftpException("Received RRQ from server while in upload")
  
          elif isinstance(pkt, TftpPacketDAT):
              self.sendError(TftpErrors.IllegalTftpOp)
              raise TftpException("Received DAT from server while in upload")
  
          else:
              self.sendError(TftpErrors.IllegalTftpOp)
              raise TftpException("Received unknown packet type from server: %s" % pkt)
  
          # By default, no state change.
          return self