Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

PostOfficeOutput Class Reference

The class defines a "Post Office", or a collection of mailboxes. Send -- send a message to a mailbox on a remote machine. More...

#include <post.h>

Inheritance diagram for PostOfficeOutput::

CallBackObj List of all members.

Public Methods

 PostOfficeOutput (double reliability, int nBoxes)
 Allocate and initialize output "reliability" is how many packets get dropped by the underlying network "nBoxes" is # of mailboxes on remote side. More...

 ~PostOfficeOutput ()
 De-allocate Post Office data. More...

void Send (PacketHeader pktHdr, MailHeader mailHdr, char *data)
 Send a message to a mailbox on a remote machine. The fromBox in the MailHeader is the return box for ack's. More...

void CallBack ()
 Called when outgoing packet has been put on network; next packet can now be sent. More...


Private Attributes

NetworkOutputnetwork
 Physical network connection. More...

SemaphoremessageSent
 V'ed when next message can be sent to network. More...

LocksendLock
 Only one outgoing message at a time. More...

int numBoxes
 Number of mail boxes on *remote* side. More...


Detailed Description

The class defines a "Post Office", or a collection of mailboxes. Send -- send a message to a mailbox on a remote machine.

Definition at line 132 of file post.h.


Constructor & Destructor Documentation

PostOfficeOutput::PostOfficeOutput ( double reliability,
int nBoxes )
 

Allocate and initialize output "reliability" is how many packets get dropped by the underlying network "nBoxes" is # of mailboxes on remote side.

PostOfficeOutput::PostOfficeOutput Initialize the post office output queue.

"reliability" is the probability that a network packet will be delivered (e.g., reliability = 1 means the network never drops any packets; reliability = 0 means the network never delivers any packets)

"nBoxes" is the number of mail boxes in this Post Office

Definition at line 277 of file post.cc.

PostOfficeOutput::~PostOfficeOutput ( )
 

De-allocate Post Office data.

PostOfficeOutput::~PostOfficeOutput De-allocate the post office data structures.

Definition at line 291 of file post.cc.


Member Function Documentation

void PostOfficeOutput::CallBack ( ) [virtual]
 

Called when outgoing packet has been put on network; next packet can now be sent.

PostOfficeOutput::CallBack Interrupt handler, called when the next packet can be put onto the network.

Called even if the previous packet was dropped.

Reimplemented from CallBackObj.

Definition at line 354 of file post.cc.

void PostOfficeOutput::Send ( PacketHeader pktHdr,
MailHeader mailHdr,
char * data )
 

Send a message to a mailbox on a remote machine. The fromBox in the MailHeader is the return box for ack's.

PostOfficeOutput::Send Concatenate the MailHeader to the front of the data, and pass the result to the Network for delivery to the destination machine.

Note that the MailHeader + data looks just like normal payload data to the Network.

"pktHdr" -- source, destination machine ID's

"mailHdr" -- source, destination mailbox ID's

"data" -- payload message data

Definition at line 314 of file post.cc.

Referenced by NetKernel::SelfTest().


Member Data Documentation

Semaphore * PostOfficeOutput::messageSent [private]
 

V'ed when next message can be sent to network.

Definition at line 151 of file post.h.

NetworkOutput * PostOfficeOutput::network [private]
 

Physical network connection.

Definition at line 150 of file post.h.

int PostOfficeOutput::numBoxes [private]
 

Number of mail boxes on *remote* side.

Definition at line 153 of file post.h.

Lock * PostOfficeOutput::sendLock [private]
 

Only one outgoing message at a time.

Definition at line 152 of file post.h.


The documentation for this class was generated from the following files:
Generated at Wed Jul 4 11:32:24 2001 for Nachos by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001