Esempio n. 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()
Esempio n. 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()
Esempio n. 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()
Esempio n. 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
Esempio n. 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()
Esempio n. 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