|
tufao
0.8.1
An asynchronous web framework for C++ built on top of Qt
|
The Tufao::AbstractMessageSocket class represents a socket that sends and receives messages. More...
Inheritance diagram for Tufao::AbstractMessageSocket:
Collaboration diagram for Tufao::AbstractMessageSocket:Public Slots | |
| virtual void | close ()=0 |
| This method should close the connection. | |
| virtual bool | sendMessage (const QByteArray &msg)=0 |
| This method should send a new message if the connection is open. More... | |
Signals | |
| void | connected () |
| This signal should be emitted when the connection is open. More... | |
| void | disconnected () |
| This signal should be emitted when the connection is closed or when fails to connect. More... | |
| void | newMessage (QByteArray msg) |
| This signal should be emitted each time a new message is available. More... | |
Public Member Functions | |
| AbstractMessageSocket (QObject *parent=0) | |
| Constructs a Tufao::AbstractMessageSocket object. More... | |
| bool | isConnected () const |
| Returns true if the connection is open. | |
Properties | |
| bool | connected |
The Tufao::AbstractMessageSocket class represents a socket that sends and receives messages.
Classes implementing Tufao::AbstractMessageSocket can provide several high level functionalities, such as:
It's main purpose is to allow easily change the message exchange mechanism in algorithms that depends on message passing. You could use it, for example, to allow a class that provide a RPC mechanism to work on different connections types.
|
explicit |
Constructs a Tufao::AbstractMessageSocket object.
parent is passed to the QObject constructor.
|
signal |
This signal should be emitted when the connection is open.
|
signal |
This signal should be emitted when the connection is closed or when fails to connect.
|
signal |
This signal should be emitted each time a new message is available.
|
pure virtualslot |
This method should send a new message if the connection is open.
The object should discard the message if the connection is closed, but it may implement a different behavior (and return true).