|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnachos.network.MailMessage
public class MailMessage
A mail message. Includes a packet header, a mail header, and the actual payload.
Packet| Field Summary | |
|---|---|
byte[] |
contents
The contents of this message, excluding the mail message header. |
int |
dstPort
The port used by this message on the destination machine. |
static int |
headerLength
The number of bytes in a mail header. |
static int |
maxContentsLength
Maximum payload (real data) that can be included in a single mesage. |
Packet |
packet
This message, as a packet that can be sent through a network link. |
static int |
portLimit
The upper limit on mail ports. |
int |
srcPort
The port used by this message on the source machine. |
| Constructor Summary | |
|---|---|
MailMessage(int dstLink,
int dstPort,
int srcLink,
int srcPort,
byte[] contents)
Allocate a new mail message to be sent, using the specified parameters. |
|
MailMessage(Packet packet)
Allocate a new mail message using the specified packet from the network. |
|
| Method Summary | |
|---|---|
String |
toString()
Return a string representation of the message headers. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public Packet packet
public int dstPort
public int srcPort
public byte[] contents
public static final int headerLength
| offset | size | value |
| 0 | 1 | destination port |
| 1 | 1 | source port |
public static final int maxContentsLength
public static final int portLimit
| Constructor Detail |
|---|
public MailMessage(int dstLink,
int dstPort,
int srcLink,
int srcPort,
byte[] contents)
throws MalformedPacketException
dstLink - the destination link address.dstPort - the destination port.srcLink - the source link address.srcPort - the source port.contents - the contents of the packet.
MalformedPacketException
public MailMessage(Packet packet)
throws MalformedPacketException
packet - the packet containg the mail message.
MalformedPacketException| Method Detail |
|---|
public String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||