玉兔远程控制
0.1.0-bate11
Toggle main menu visibility
载入中...
搜索中...
未找到
Src
Channel
Channel.h
1
// Author: Kang Lin <kl222@126.com>
2
3
#ifndef CDATACHANNEL_H
4
#define CDATACHANNEL_H
5
6
#pragma once
7
8
#include <QIODevice>
9
#include <QTcpSocket>
10
#include <QMessageBox>
11
#include <QMutex>
12
#include "plugin_export.h"
13
#include "Stats.h"
14
15
#define DEFAULT_TIMEOUT 500000
16
27
class
PLUGIN_EXPORT
CChannel
:
public
QIODevice
28
{
29
Q_OBJECT
30
31
public
:
37
explicit
CChannel
(QTcpSocket* pSocket, QObject *parent =
nullptr
);
38
virtual
~CChannel
();
39
45
virtual
bool
open
(OpenMode mode)
override
;
46
virtual
void
close()
override
;
47
50
virtual
QString
GetDetails
();
51
53
static
int
InitTranslation
();
55
static
int
RemoveTranslation
();
56
57
Q_SIGNALS:
61
void
sigConnected
();
63
void
sigDisconnected
();
65
void
sigError
(
int
nErr,
const
QString& szErr);
66
71
void
sigSecurityLevel
(CSecurityLevel::Levels level);
76
void
sigSend
(quint64 counts);
81
void
sigReceive
(quint64 counts);
82
83
private
Q_SLOTS:
84
void
slotError(QAbstractSocket::SocketError e);
85
86
private
:
87
QTcpSocket* m_pSocket;
88
89
protected
:
90
explicit
CChannel
(QObject *parent =
nullptr
);
91
92
// QIODevice interface
93
protected
:
94
virtual
qint64 readData(
char
*data, qint64 maxlen)
override
;
95
virtual
qint64 writeData(
const
char
*data, qint64 len)
override
;
96
virtual
bool
isSequential()
const override
;
97
};
98
99
#endif
// CDATACHANNEL_H
CChannel::RemoveTranslation
static int RemoveTranslation()
Remove translation
定义
Channel.cpp:142
CChannel::InitTranslation
static int InitTranslation()
Initial translation
定义
Channel.cpp:134
CChannel::sigSend
void sigSend(quint64 counts)
Send data counts
CChannel::sigConnected
void sigConnected()
emit when the channel is connected.
CChannel::sigReceive
void sigReceive(quint64 counts)
Receive data counts
CChannel::sigDisconnected
void sigDisconnected()
emit when the channel is disconnected
CChannel::sigError
void sigError(int nErr, const QString &szErr)
emit when the channel is error
CChannel::sigSecurityLevel
void sigSecurityLevel(CSecurityLevel::Levels level)
当安全级别改变时触发
CChannel::open
virtual bool open(OpenMode mode) override
定义
Channel.cpp:92
CChannel::GetDetails
virtual QString GetDetails()
依赖信息
定义
Channel.cpp:129
CChannel::CChannel
CChannel(QTcpSocket *pSocket, QObject *parent=nullptr)
CChannel
定义
Channel.cpp:19
作者:康林 (kl222@126.com)
版权所有(c) 康林工作室 保留所有权力