XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 5.1.2
    • None
    • Management API
    • None

    Description

      This is my python code
      ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      import struct
      import socket

      query = 'proxy.process.cache.read.success'
      msg = struct.pack('h', 3)
      msg += struct.pack('i', len(query))
      msg += query

      s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
      s.connect("/opt/ats/var/trafficserver/mgmtapisocket")
      s.send(msg)
      data = s.recv(1024)
      s.close()

      1. raw data
        print 'Received', repr(data)

      if data:
      offset = 0
      ret_stat, op_t = struct.unpack_from('hi', data, offset)
      offset += 2 + 4 + 2
      int_0, int_1 = struct.unpack_from('ii', data, offset)
      offset += 4 * 2
      msglen, = struct.unpack_from('i', data, offset)
      offset += 4
      msg = data[offset:msglen]
      offset += msglen

      dlen, = struct.unpack_from('i', data, offset)
      offset += 4
      d = data[offset:dlen]

      print ret_stat, op_t, int_0, int_1, msglen, msg, dlen, d

      ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

      Received '\x00\x00\x08\x00\x00\x00 \x00\x00\x00\x00\x00\x0e\x00\x00\x00\x00\x00\x00\x00proxy.process.cache.read.success'
      ##############################################################

      What this data format , how do I solve the binary package, please help me

      Attachments

        Activity

          People

            jamespeach James Peach
            xieyugui daemon
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: