#include <network.h>
Inheritance diagram for NetworkOutput::

Public Methods | |
| NetworkOutput (double reliability, CallBackObj *toCall) | |
| Allocate and initialize network output driver. More... | |
| ~NetworkOutput () | |
| De-allocate the network input driver data. More... | |
| void | Send (PacketHeader hdr, char *data) |
| Send the packet data to a remote machine, specified by "hdr". Returns immediately. "callWhenDone" is invoked once the next packet can be sent. Note that callWhenDone is called whether or not the packet is dropped, and note that the "from" field of the PacketHeader is filled in automatically by Send(). More... | |
| void | CallBack () |
| Interrupt handler, called when message is sent. More... | |
Private Attributes | |
| int | sock |
| UNIX socket number for outgoing packets. More... | |
| double | chanceToWork |
| Likelihood packet will be dropped. More... | |
| CallBackObj* | callWhenDone |
| Interrupt handler, signalling next packet can be sent. More... | |
| bool | sendBusy |
| Packet is being sent. More... | |
Definition at line 94 of file network.h.
|
|
Allocate and initialize network output driver. NetworkOutput::NetworkOutput Initialize the simulation for sending network packets "reliability" says whether we drop packets to emulate unreliable links "toCall" is the interrupt handler to call when next packet can be sent Definition at line 113 of file network.cc. |
|
|
De-allocate the network input driver data. NetworkOutput::~NetworkOutput Deallocate the simulation for sending network packets Definition at line 130 of file network.cc. |
|
|
Interrupt handler, called when message is sent.
Reimplemented from CallBackObj. Definition at line 141 of file network.cc. |
|
|
Send the packet data to a remote machine, specified by "hdr". Returns immediately. "callWhenDone" is invoked once the next packet can be sent. Note that callWhenDone is called whether or not the packet is dropped, and note that the "from" field of the PacketHeader is filled in automatically by Send(). NetworkOutput::Send Send a packet into the simulated network, to the destination in hdr. Concatenate hdr and data, and schedule an interrupt to tell the user when the next packet can be sent Note we always pad out a packet to MaxWireSize before putting it into the socket, because it's simpler at the receive end. Definition at line 159 of file network.cc. Referenced by PostOfficeOutput::Send().
|
|
|
Interrupt handler, signalling next packet can be sent.
|
|
|
Likelihood packet will be dropped.
|
|
|
Packet is being sent.
|
|
|
UNIX socket number for outgoing packets.
|
1.2.8.1 written by Dimitri van Heesch,
© 1997-2001