class Packet

Packet is the unit of communication when using a Connection. More...

Definition#include <sysadm/Packet.h>
InheritsAttrBundle
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods


Detailed Description

Packet is the unit of communication when using a Connection. A packet has a type, which represents a service, and a selector, which represents an operation within that service. Most information in a packet is contained in typed/key value pairs, which Packet inherits from AttrBundle.

A Packet can be used to send and receive arbitrary data using the setData() and getData() methods. A packet that has data associated with it via setData() cannot be transmitted across the network in a byte-order independent manner, however, so this facility should only be used when the data being transported can be interpreted independently of byte-order.

 Packet (const String& type, const String& selector)

Constructor for creating a new packet from scratch.

 Packet (const String& stream)

Constructor for creating a packet from a serialized attribute bundle.

void  setData (void* data, size_t length)

[virtual]

Set data for this packet. The data is not freed by the packet's destructor.

const void*  getData ()

[const virtual]

Get the data for this packet. The return value is owned by the creator of this packet, and should not be assumed to be valid beyond the lifetime of this packet.

size_t  getDataLength ()

[const virtual]

Get the number of bytes of data.


Generated by: rusty@irem on Mon Sep 18 18:07:52 2000, using kdoc 2.0a36.