Public Member Functions | Private Slots | Private Member Functions | Private Attributes

# ShTcpServer Class Reference

Allows other applications to interact with the system via TCP/IP connection. More...

`#include <shtcpserver.h>`

Inheritance diagram for ShTcpServer:
[legend]
Collaboration diagram for ShTcpServer:
[legend]

List of all members.

## Public Member Functions
| ShTcpServer ()
virtual | ~ShTcpServer ()
virtual bool | init (QString param)
| Initialization of the plug-in, creating a TCP/IP listener.
virtual void | updatePins (const QList< ShPin > &pins)
virtual void | processMessage (ShMessagePtr message)
| Relays the message to the TCP/IP socket.
## Private Slots
void | newClientConnected ()
| Slot accepting new client connection.
void | dataAvailable ()
| Slot reading incoming data.
## Private Member Functions
void | processPacket (const QString &cmd)
| Parses and dispatches a command received through TCP/IP connection.
## Private Attributes
QTcpServer * | mTcpServer
QTcpSocket * | mClientConnection
char | mBuffer [1024]
qint64 | mBufLen

## Detailed Description

Allows other applications to interact with the system via TCP/IP connection.

Definition at line 35 of file shtcpserver.h.

## Constructor & Destructor Documentation

ShTcpServer::ShTcpServer | ( |  | ) | `[inline]`

Definition at line 41 of file shtcpserver.h.

References mBufLen.

virtual ShTcpServer::~ShTcpServer | ( |  | ) | `[inline, virtual]`

Definition at line 42 of file shtcpserver.h.

## Member Function Documentation

void ShTcpServer::dataAvailable | ( |  | ) | `[private, slot]`

Slot reading incoming data.

Definition at line 101 of file shtcpserver.cpp.

References mBuffer, mBufLen, mClientConnection, and processPacket().

Referenced by newClientConnected().

Here is the call graph for this function:

Here is the caller graph for this function:

bool ShTcpServer::init | ( | QString | param | ) | `[virtual]`

Initialization of the plug-in, creating a TCP/IP listener.

Parameters:

  | param | Defines the host, port and details of communication protocol

Returns:
  true if the plug-in has been initialized successfully

Implements ShObject.

Definition at line 27 of file shtcpserver.cpp.

References mClientConnection, mTcpServer, newClientConnected(), and ShObjectHelper::setIdApi().

Here is the call graph for this function:

void ShTcpServer::newClientConnected | ( |  | ) | `[private, slot]`

Slot accepting new client connection.

Definition at line 88 of file shtcpserver.cpp.

References dataAvailable(), mClientConnection, and mTcpServer.

Referenced by init().

Here is the call graph for this function:

Here is the caller graph for this function:

void ShTcpServer::processMessage | ( | ShMessagePtr | message | ) | `[virtual]`

Relays the message to the TCP/IP socket.

Parameters:

  | message | Shared pointer to the message

Definition at line 50 of file shtcpserver.cpp.

References mClientConnection.

void ShTcpServer::processPacket | ( | const QString & | cmd | ) | `[private]`

Parses and dispatches a command received through TCP/IP connection.

Parameters:

  | cmd | Received command

Definition at line 66 of file shtcpserver.cpp.

References ShObjectHelper::dispatchMessage().

Referenced by dataAvailable().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void ShTcpServer::updatePins | ( | const QList< ShPin > & | pins | ) | `[inline, virtual]`

Implements ShObject.

Definition at line 44 of file shtcpserver.h.

## Member Data Documentation

char ShTcpServer::mBuffer[1024]`[private]`

Definition at line 57 of file shtcpserver.h.

Referenced by dataAvailable().

qint64 ShTcpServer::mBufLen`[private]`

Definition at line 58 of file shtcpserver.h.

Referenced by dataAvailable(), and ShTcpServer().

QTcpSocket* ShTcpServer::mClientConnection`[private]`

Definition at line 55 of file shtcpserver.h.

Referenced by dataAvailable(), init(), newClientConnected(), and processMessage().

QTcpServer* ShTcpServer::mTcpServer`[private]`

Definition at line 54 of file shtcpserver.h.

Referenced by init(), and newClientConnected().

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

- shtcpserver/shtcpserver.h
- shtcpserver/shtcpserver.cpp

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends