dmuNetworkRecv
Inherits from: dmuNetwork
#include "dmuNetworkRecv.h"
Overview
This object provide the ability to get dm buffers from across
the network. This object is a subclass of the dmuNetwork
object. This object must be the head of a chain.
See the source code for more info and implementation details.
Public Methods
- dmuNetworkRecv()
Constructor: This constructor sets up some default values.
If you use this constructor, you must set the image
width and height before you call the setup method.
- dmuNetworkRecv(int imageSizeX, int imageSizeY)
Constructor: You probably want to use this constructor. It set some
default values and sets the image width and height.
- ~dmuNetworkRecv()
Destructor: Right now this does nothing.
- int init(dmuParams *params = NULL)
This method creates the dmbuffer pool
- virtual int start(int propagate = DMU_PROPAGATE)
starts the object reading from the network. This method actually
sprocs a read thread that will try to get data from the network.
- virtual int stop()
This method will stop the read thread from reading anymore data
from the network.
- int receive(DMbuffer inBuffer)
This method should never be called on this object.
This object can never be anything but the head of a chain
so nothing should pass buffers to this object.
- int handleEvents(fd_set fdSet)
This method will pass the buffer that was just read from the network
on down to the children of this object
- void setPacking(DMimagepacking _packing)
tell the object what the packing format of that data to expect.
This is very important. The size of each dmbuffer depends on the
packing, so this must be set correctly before calling init.
- DMimagepacking getPacking()
return the current packing
- void setImageDimensions(int _imageSizeX, int _imageSizeY)
Tells the object that size of the image so it can allocate
buffers of the correct size
- void readLoop()
this is the loop that reads from the network. This should never
be call directly, it is called indirectly from the start method.
- virtual int getFD()
This method returns the fd to use in the select call in the
main event loop.
- int getLastHeaderVal()
return the data send along with the buffer sent across the
network.
Overview Object List Object Hierarchy
Sample Apps