|
|
DatagramPacket Class ReferenceInheritance diagram for DatagramPacket:
[legend]Collaboration diagram for DatagramPacket:
[legend]List of all members.
|
Public Member Functions |
| DatagramPacket (void *buf, int length) |
| DatagramPacket (void *buf, int length, InetAddress address, int port) |
| DatagramPacket (void *buf, int offset, int length) |
| DatagramPacket (void *buf, int offset, int length, InetAddress address, int port) |
InetAddress | getAddress () const |
void * | getData () const |
int | getLength () const |
int | getOffset () const |
int | getPort () const |
void | setData (void *buf) |
void | setData (void *buf, int offset, int length) |
void | setLength (int length) |
Protected Attributes |
void * | buf |
int | offset |
int | length |
InetAddress | address |
int | port |
Detailed Description
This class represents a datagram packet.
Datagram packets are used to implement a connectionless packet delivery service. Each message is routed from one machine to another based solely on information contained within that packet. Multiple packets sent from one machine to another might be routed differently, and might arrive in any order.
Constructor & Destructor Documentation
DatagramPacket |
( |
void * |
buf, |
|
|
int |
length, |
|
|
InetAddress |
address, |
|
|
int |
port |
|
) |
|
|
|
Constructs a datagram packet for sending packets of length length to the specified port number on the specified host. |
|
Constructs a DatagramPacket for receiving packets of length length , specifying an offset into the buffer. |
DatagramPacket |
( |
void * |
buf, |
|
|
int |
offset, |
|
|
int |
length, |
|
|
InetAddress |
address, |
|
|
int |
port |
|
) |
|
|
|
Constructs a datagram packet for sending packets of length length with offset offset to the specified port number on the specified host. |
Member Function Documentation
InetAddress getAddress |
( |
|
) |
const [inline] |
|
|
Returns the IP address of the machine to which this datagram is being sent or from which the datagram was received. |
void* getData |
( |
|
) |
const [inline] |
|
|
Returns the data received or the data to be sent. |
int getLength |
( |
|
) |
const [inline] |
|
|
Returns the length of the data to be sent or the length of the data received. |
int getOffset |
( |
|
) |
const [inline] |
|
|
Returns the offset of the data to be sent or the offset of the data received. |
int getPort |
( |
|
) |
const [inline] |
|
|
Returns the port number on the remote host to which this datagram is being sent or from which the datagram was received. |
void setData |
( |
void * |
buf, |
|
|
int |
offset, |
|
|
int |
length |
|
) |
[inline] |
|
|
Set the data buffer for this packet. |
void setData |
( |
void * |
buf |
) |
[inline] |
|
|
Set the data buffer for this packet. |
void setLength |
( |
int |
length |
) |
[inline] |
|
|
Set the length for this packet. |
Member Data Documentation
|
The IP address for this packet. |
|
the data for this packet. |
|
The length of the data for this packet. |
|
The offset of the data for this packet. |
|
The UDP port number of the remote host. |
The documentation for this class was generated from the following files:
- datagrampacket.h
- datagrampacket.cpp
|
|
Copyright © 1999-2004, Apache Software Foundation
|