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>
53 bufferAlertNeeded(false),
63 allocate(readSize, writeSize);
67 virtual bool open(
const Contact& remote);
71 virtual bool openMcast(
const Contact& group,
75 virtual int restrictMcast(ACE_SOCK_Dgram_Mcast* dmcast,
107 return remoteAddress;
110 void interrupt()
override;
117 virtual void closeMain();
125 void flush()
override;
127 bool isOk()
const override;
129 void reset()
override;
131 void beginPacket()
override;
133 void endPacket()
override;
137 bool setTypeOfService(
int tos)
override;
139 int getTypeOfService()
override;
147 void removeMonitor();
159 bool closed, interrupting, reader;
161 ACE_SOCK_Dgram* dgram;
162 ACE_SOCK_Dgram_Mcast* mgram;
163 ACE_INET_Addr localHandle, remoteHandle;
168 int localHandle, remoteHandle;
170 Contact localAddress, remoteAddress, restrictInterfaceIp;
176 bool bufferAlertNeeded;
180 double lastReportTime;
182 void allocate(
int readSize = 0,
int writeSize = 0);
184 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)
virtual void onMonitorInput()
const Contact & getRemoteAddress() const override
Get the address of the remote side of the stream.
const Contact & getLocalAddress() const override
Get the address of the local side of the stream.
void close() override
Terminate the stream.
InputStream & getInputStream() override
Get an InputStream to read from.
virtual void onMonitorOutput()
virtual bool openMonitor(int readSize=0, int writeSize=0)
virtual bool join(const Contact &group, bool sender)
OutputStream & getOutputStream() override
Get an OutputStream to write to.
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.
The components from which ports and connections are built.
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)