Loading...
Searching...
No Matches
LocalSocketConnection Class Reference

`#include <localsocketconnection.h>`

Inheritance diagram for LocalSocketConnection:

## Public Member Functions

| LocalSocketConnection (QObject *parentObject, QLocalSocket *socket)
| LocalSocketConnection (QObject *parentObject, const QString &connectionString)
void | open () override
void | start () override
void | close () override
bool | isOpen () override
QString | connectionString () const override
bool | send (const PacketType &packet, const EndpointIdType &endpoint) override
void | flush () override
Public Member Functions inherited from Connection
| Connection (QObject *parentObject=nullptr)

## Additional Inherited Members

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

## Detailed Description

Provides an implementation of Connection using QLocalSockets. Each instance of the class wraps a QLocalSocket.

<avogadro/rpc/localsocketconnection.h>

## Constructor & Destructor Documentation

## LocalSocketConnection() [1/2]

LocalSocketConnection | ( | QObject * | parentObject,
|  | QLocalSocket * | socket )

explicit

Constructor used by LocalSocketConnectionListener to create a new connection based on an existing QLocalSocket.

## LocalSocketConnection() [2/2]

LocalSocketConnection | ( | QObject * | parentObject,
|  | const QString & | connectionString )

explicit

Constructor used by a client to connect to a server.

## Member Function Documentation

## open()

void open | ( |  | ) |

override virtual

Opens the connection to the server.

Implements Connection.

## start()

void start | ( |  | ) |

override virtual

Start receiving messages on this connection.

Implements Connection.

## close()

void close | ( |  | ) |

override virtual

Close the underlying socket.

Implements Connection.

## isOpen()

bool isOpen | ( |  | ) |

override virtual

Returns
  true if connection is open, false otherwise

Implements Connection.

## connectionString()

QString connectionString | ( |  | ) | const

override virtual

Returns
  The serverName from the underlying socket

Implements Connection.

## send()

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

override virtual

Send the packet on the connection to endpoint.

Implements Connection.

## flush()

void flush | ( |  | ) |

override virtual

Flush all pending messages to the other endpoint.

Implements Connection.