OpenCurves  0.9
RealTimeUdpConnection Class Reference

A RealTimeSource which reads from a UDP socket. More...

#include <realtimeudpconnection.h>

Inheritance diagram for RealTimeUdpConnection:
RealTimeConnection

Public Member Functions

 RealTimeUdpConnection ()
 Create an unconnected UDP connection.
 
 ~RealTimeUdpConnection ()
 Destructor, ensures disconnect() is called.
 
virtual QString name () const override
 The UDP address being used. More...
 
bool open (const QHostAddress &address, quint16 port)
 Open a UDP connection to the indicated address and port. More...
 
virtual bool isConnected () const override
 Is the port open for communication? More...
 
virtual void disconnect () override
 Disconnect if connected.
 
int send (const QByteArray &buffer) override
 Send the given buffer to the source. More...
 
int read (QByteArray &buffer) override
 Read data into the given buffer. More...
 
- Public Member Functions inherited from RealTimeConnection
virtual ~RealTimeConnection ()
 Virtual destructor.
 

Detailed Description

A RealTimeSource which reads from a UDP socket.

Member Function Documentation

virtual bool RealTimeUdpConnection::isConnected ( ) const
overridevirtual

Is the port open for communication?

Returns
True if open.

Implements RealTimeConnection.

virtual QString RealTimeUdpConnection::name ( ) const
overridevirtual

The UDP address being used.

Returns
The UDP connection name.

Implements RealTimeConnection.

bool RealTimeUdpConnection::open ( const QHostAddress &  address,
quint16  port 
)

Open a UDP connection to the indicated address and port.

Closes the existing connection as required.

This function may block for up to the specified timeout, attempting to establish a connection. After this time has elapsed, the connection is deemed to have failed.

Parameters
addressThe target address.
portThe connection port.
Returns
True if the connection is successfully established.
int RealTimeUdpConnection::read ( QByteArray &  buffer)
overridevirtual

Read data into the given buffer.

Parameters
bufferThe buffer to read into.

Implements RealTimeConnection.

int RealTimeUdpConnection::send ( const QByteArray &  buffer)
overridevirtual

Send the given buffer to the source.

Parameters
bufferThe buffer to send.

Implements RealTimeConnection.


The documentation for this class was generated from the following file: