Loading...
Searching...
No Matches
Connection Class Referenceabstract

`#include <avogadro/rpc/connection.h>`

Inheritance diagram for Connection:

## Signals

void | packetReceived (const Avogadro::RPC::PacketType &packet, const Avogadro::RPC::EndpointIdType &endpoint)
void | disconnected ()

## Public Member Functions

| Connection (QObject *parentObject=nullptr)
virtual void | open ()=0
virtual void | start ()=0
virtual void | close ()=0
virtual bool | isOpen ()=0
virtual QString | connectionString () const =0
virtual bool | send (const PacketType &packet, const EndpointIdType &endpoint)=0
virtual void | flush ()=0

## Detailed Description

The Connection class is an interface defining the connection used to communicate between processes. Subclasses provide concrete implementations, for example based on local sockets.

See also
  LocalSocketConnection

## Member Function Documentation

## open()

virtual void open | ( |  | ) |

pure virtual

Open the connection.

Implemented in LocalSocketConnection.

## start()

virtual void start | ( |  | ) |

pure virtual

Start receiving messages on this connection.

Implemented in LocalSocketConnection.

## close()

virtual void close | ( |  | ) |

pure virtual

Close the connection. Once a connection is closed it can't be reused.

Implemented in LocalSocketConnection.

## isOpen()

virtual bool isOpen | ( |  | ) |

pure virtual

Returns
  true if the connection is open, false otherwise

Implemented in LocalSocketConnection.

## connectionString()

virtual QString connectionString | ( |  | ) | const

pure virtual

Returns
  the connection string describing the endpoint

Implemented in LocalSocketConnection.

## send()

virtual bool send | ( | const PacketType & | packet,
|  | const EndpointIdType & | endpoint )

pure virtual

Send the packet on the connection to endpoint.

Implemented in LocalSocketConnection.

## flush()

virtual void flush | ( |  | ) |

pure virtual

Flush all pending messages to the other endpoint.

Implemented in LocalSocketConnection.

## packetReceived

void packetReceived | ( | const Avogadro::RPC::PacketType & | packet,
|  | const Avogadro::RPC::EndpointIdType & | endpoint )

signal

Emitted when a new message has been received on this connection.

## disconnected

void disconnected | ( |  | ) |

signal

Emitted when the connection is disconnected.