code: def _sb_decoder(self):
          
          #print "at decoder"
          bloc = self.telnet_sb_buffer
          if len(bloc) > 2:
  
              if bloc[0] == TTYPE and bloc[1] == IS:
                  self.terminal_type = bloc[2:]
                  #print "Terminal type = '%s'" % self.terminal_type
  
              if bloc[0] == NAWS:
                  if len(bloc) != 5:
                      print "Bad length on NAWS SB:", len(bloc)
                  else:
                      self.columns = (256 * ord(bloc[1])) + ord(bloc[2])
                      self.rows = (256 * ord(bloc[3])) + ord(bloc[4])
  
                  #print "Screen is %d x %d" % (self.columns, self.rows)
  
          self.telnet_sb_buffer = ''
docs: Figures out what to do with a received sub-negotiation block.