示例#1
0
def pn_data_get_uuid(data):
    u = data.getUUID()
    ba = zeros(16, 'b')
    bb = ByteBuffer.wrap(ba)
    bb.putLong(u.getMostSignificantBits())
    bb.putLong(u.getLeastSignificantBits())
    return ba.tostring()
示例#2
0
def pn_data_get_uuid(data):
  u = data.getUUID()
  ba = zeros(16, 'b')
  bb = ByteBuffer.wrap(ba)
  bb.putLong(u.getMostSignificantBits())
  bb.putLong(u.getLeastSignificantBits())
  return ba.tostring()
示例#3
0
def pn_transport_peek(trans, size):
  size = min(trans.impl.pending(), size)
  ba = zeros(size, 'b')
  if size:
    bb = trans.impl.head()
    bb.get(ba)
    bb.position(0)
  return 0, ba.tostring()
示例#4
0
def pn_link_recv(link, limit):
  ary = zeros(limit, 'b')
  n = link.impl.recv(ary, 0, limit)
  if n >= 0:
    bytes = ary[:n].tostring()
  else:
    bytes = None
  return n, bytes
示例#5
0
def pn_transport_peek(trans, size):
  size = min(trans.impl.pending(), size)
  ba = zeros(size, 'b')
  if size:
    bb = trans.impl.head()
    bb.get(ba)
    bb.position(0)
  return 0, ba.tostring()
示例#6
0
def pn_link_recv(link, limit):
  ary = zeros(limit, 'b')
  n = link.impl.recv(ary, 0, limit)
  if n >= 0:
    bytes = ary[:n].tostring()
  else:
    bytes = None
  return n, bytes