65 lines
1.4 KiB
C++
65 lines
1.4 KiB
C++
/*! \file picloudtcp.h
|
|
* \brief PICloud TCP transport
|
|
*/
|
|
/*
|
|
PIP - Platform Independent Primitives
|
|
PICloud TCP transport
|
|
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU Lesser General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU Lesser General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#ifndef PICLOUDTCP_H
|
|
#define PICLOUDTCP_H
|
|
|
|
#include "pip_cloud_export.h"
|
|
#include "pistring.h"
|
|
|
|
|
|
namespace PICloud {
|
|
|
|
enum Version {
|
|
Version_1 = 1,
|
|
};
|
|
|
|
enum HeaderType {
|
|
Server = 1,
|
|
Client = 2,
|
|
};
|
|
|
|
struct PIP_CLOUD_EXPORT Header {
|
|
Header() {
|
|
version = Version_1;
|
|
}
|
|
uchar version; // PICloud::Version
|
|
uchar type; // PICloud::HeaderType
|
|
PIString sname; // server name
|
|
};
|
|
|
|
|
|
class PIP_CLOUD_EXPORT TCP {
|
|
public:
|
|
TCP();
|
|
|
|
private:
|
|
|
|
};
|
|
|
|
}
|
|
|
|
PIP_CLOUD_EXPORT PIByteArray & operator <<(PIByteArray & s, const PICloud::Header & v);
|
|
PIP_CLOUD_EXPORT PIByteArray & operator >>(PIByteArray & s, PICloud::Header & v);
|
|
|
|
#endif // PICLOUDTCP_H
|