A simple network client.
More...
|
|
typedef QPair< QString, QVariant > | Packet |
| |
|
|
void | connected () |
| |
|
void | disconnected () |
| |
|
void | error (QLocalSocket::LocalSocketError socketError) |
| |
|
void | readyRead () |
| |
|
void | stateChanged (QLocalSocket::LocalSocketState socketState) |
| |
| SimpleSocket::SimpleSocket |
( |
QObject * |
parent = 0) | |
|
|
explicit |
constructor
- Parameters
-
| [in] | parent | parent of this QObject |
| void SimpleSocket::abort |
( |
) | |
|
| bool SimpleSocket::atEnd |
( |
) | |
const |
check if no pending data
- Returns
- true if no pending data
| void SimpleSocket::close |
( |
) | |
|
| void SimpleSocket::connectToServer |
( |
const QString & |
name, |
|
|
QIODevice::OpenMode |
openMode = QIODevice::ReadWrite |
|
) |
| |
connect to a server
- Parameters
-
| [in] | name | server name |
| [in] | openMode | read or write |
| QLocalSocket::LocalSocketError SimpleSocket::error |
( |
) | |
const |
get last error code
- Returns
- last error code
| QString SimpleSocket::errorString |
( |
) | |
const |
get last error message
- Returns
- last error message
| bool SimpleSocket::flush |
( |
) | |
|
flush pending socket
- Returns
- true if data flushed
| QString SimpleSocket::fullServerName |
( |
) | |
const |
get full server name
- Returns
- full server name
| bool SimpleSocket::isValid |
( |
) | |
const |
check socket state
- Returns
- true if socket is still connecting
| SimpleSocket::Packet SimpleSocket::read |
( |
) | |
|
read one data
- Returns
- a packet
| QString SimpleSocket::serverName |
( |
) | |
const |
get short server name
- Returns
- short server name
| QLocalSocket::LocalSocketState SimpleSocket::state |
( |
) | |
const |
get socket state
- Returns
- current socket state
| bool SimpleSocket::waitForReadyRead |
( |
int |
msecs = 30000) | |
|
block until read something
- Returns
- true if read something and not timeout
| void SimpleSocket::write |
( |
const QString & |
header, |
|
|
const QVariant & |
data |
|
) |
| const |
send packet
- Parameters
-
| [in] | header | packet header |
| [in] | data | packet data |
The documentation for this class was generated from the following files: