transport Package

transport Package

Required to distribute different parts of this package as multiple distributables

chunking Module

Chunking helpers

class vmware.vapi.protocol.common.transport.chunking.BufferedChunker(chunked_write_cb, chunk_size=4096)[source]

Bases: object

Buffered chunker

Buffered chunker init

Parameters:
  • chunked_write_cb (function) – chunked write callback
  • chunk_size (int) – chunk size
close()[source]
flush()[source]
write(data)[source]
Parameters:data (str) – data to write
class vmware.vapi.protocol.common.transport.chunking.ChunkedMsgAccumulator(completed_msg_cb, aborted_msg_cb=None)[source]

Bases: vmware.vapi.protocol.common.transport.chunking.ChunksHandler

Chunked message accumulator

Chunked message accumulator init

Parameters:
  • completed_msg_cb (function) – message completed callback
  • completed_msg_cb – message aborted callback
class vmware.vapi.protocol.common.transport.chunking.ChunksHandler(chunks_ready_cb, chunks_abort_cb=None, chunk_window_buf=65536, wrap_around_id=4294967296L)[source]

Bases: object

Chunk handler

Chunk handler init

Parameters:
  • chunks_ready_cb (function) – Chunk ready callback
  • chunks_abort_cb (function) – Chunk abort callback
  • chunk_window_buf (int) – Chunk windows buffer size (in bytes)
  • wrap_around_id (int) – Chunk wrap around id
add_chunk(chunk_id, fin, body)[source]

got a chunk, add to handler

Parameters:
  • chunk_id (int) – Chunk id
  • fin (bool) – fin bit
  • data (str) – chunked data
class vmware.vapi.protocol.common.transport.chunking.CrazyChunkWriter(chunked_write_cb)[source]

Bases: object

Testing class for chunking

Testing class for chunking init

Parameters:chunked_write_cb (function) – write callback
chunked_write_cb(chunk_id, fin, data)[source]

Chunked write callback. Send chunk in random order / dup

Parameters:
  • chunk_id (int) – Chunk id
  • fin (bool) – fin bit
  • data (str) – chunked data
send_random_dup()[source]

Send random duplicated packet

Table Of Contents

Previous topic

msg Package

Next topic

server Package

This Page