7 #ifndef YARP_OS_IMPL_DGRAMTWOWAYSTREAM_H
8 #define YARP_OS_IMPL_DGRAMTWOWAYSTREAM_H
17 # include <ace/SOCK_Dgram.h>
18 # include <ace/SOCK_Dgram_Mcast.h>
55 bufferAlertNeeded(false),
65 allocate(readSize, writeSize);
69 virtual bool open(
const Contact& remote);
73 virtual bool openMcast(
const Contact& group,
77 virtual int restrictMcast(ACE_SOCK_Dgram_Mcast* dmcast,
109 return remoteAddress;
112 void interrupt()
override;
119 virtual void closeMain();
127 void flush()
override;
129 bool isOk()
const override;
131 void reset()
override;
133 void beginPacket()
override;
135 void endPacket()
override;
139 bool setTypeOfService(
int tos)
override;
141 int getTypeOfService()
override;
149 void removeMonitor();
161 bool closed, interrupting, reader;
163 ACE_SOCK_Dgram* dgram;
164 ACE_SOCK_Dgram_Mcast* mgram;
165 ACE_INET_Addr localHandle, remoteHandle;
170 int localHandle, remoteHandle;
172 Contact localAddress, remoteAddress, restrictInterfaceIp;
178 bool bufferAlertNeeded;
182 double lastReportTime;
184 void allocate(
int readSize = 0,
int writeSize = 0);
186 void configureSystemBuffers();
A simple abstraction for a block of bytes.
An abstraction for a block of bytes, with optional responsibility for allocating/destroying that bloc...
Simple specification of the minimum functions needed from output streams.
virtual void write(char ch)
Write a single byte to the stream.
A stream which can be asked to perform bidirectional communication.
A stream abstraction for datagram communication.
void setMonitor(const yarp::os::Bytes &data)
InputStream & getInputStream() override
Get an InputStream to read from.
virtual void onMonitorInput()
OutputStream & getOutputStream() override
Get an OutputStream to write to.
void close() override
Terminate the stream.
const Contact & getRemoteAddress() const override
Get the address of the remote side of the stream.
virtual void onMonitorOutput()
virtual bool openMonitor(int readSize=0, int writeSize=0)
virtual bool join(const Contact &group, bool sender)
const Contact & getLocalAddress() const override
Get the address of the local side of the stream.
ContainerT::value_type join(typename ContainerT::const_iterator begin, typename ContainerT::const_iterator end, const typename ContainerT::value_type &separator=", ")
Utility to join the elements in a container to a single string separated by a separator.
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
The main, catch-all namespace for YARP.