|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
10 #ifndef YARP_OS_IMPL_DGRAMTWOWAYSTREAM_H
11 #define YARP_OS_IMPL_DGRAMTWOWAYSTREAM_H
20 # include <ace/SOCK_Dgram.h>
21 # include <ace/SOCK_Dgram_Mcast.h>
58 bufferAlertNeeded(false),
68 allocate(readSize, writeSize);
72 virtual bool open(
const Contact& remote);
76 virtual bool openMcast(
const Contact& group,
80 virtual int restrictMcast(ACE_SOCK_Dgram_Mcast* dmcast,
86 virtual bool join(
const Contact& group,
bool sender,
const Contact& ipLocal);
90 return join(group, sender,
Contact());
112 return remoteAddress;
115 void interrupt()
override;
122 virtual void closeMain();
130 void flush()
override;
132 bool isOk()
const override;
134 void reset()
override;
136 void beginPacket()
override;
138 void endPacket()
override;
142 bool setTypeOfService(
int tos)
override;
144 int getTypeOfService()
override;
152 void removeMonitor();
164 bool closed, interrupting, reader;
166 ACE_SOCK_Dgram* dgram;
167 ACE_SOCK_Dgram_Mcast* mgram;
168 ACE_INET_Addr localHandle, remoteHandle;
173 int localHandle, remoteHandle;
175 Contact localAddress, remoteAddress, restrictInterfaceIp;
181 bool bufferAlertNeeded;
185 double lastReportTime;
187 void allocate(
int readSize = 0,
int writeSize = 0);
189 void configureSystemBuffers();
196 #endif // YARP_OS_IMPL_DGRAMTWOWAYSTREAM_H
A stream which can be asked to perform bidirectional communication.
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)
virtual void write(char ch)
Write a single byte to the stream.
Simple specification of the minimum functions needed from output streams.
void setMonitor(const yarp::os::Bytes &data)
virtual bool join(const Contact &group, bool sender)
OutputStream & getOutputStream() override
Get an OutputStream to write to.
const Contact & getRemoteAddress() const override
Get the address of the remote side of the stream.
void close() override
Terminate the stream.
An abstraction for a block of bytes, with optional responsibility for allocating/destroying that bloc...
virtual void onMonitorInput()
A stream abstraction for datagram communication.
A simple abstraction for a block of bytes.
virtual void onMonitorOutput()
virtual bool openMonitor(int readSize=0, int writeSize=0)
The main, catch-all namespace for YARP.
const Contact & getLocalAddress() const override
Get the address of the local side of the stream.
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
InputStream & getInputStream() override
Get an InputStream to read from.