code format
This commit is contained in:
@@ -5,30 +5,30 @@
|
||||
* \~russian TCP слой PICloud
|
||||
*/
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
PICloud TCP transport
|
||||
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
|
||||
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 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.
|
||||
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/>.
|
||||
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 "pimutex.h"
|
||||
#include "pip_cloud_export.h"
|
||||
#include "pistring.h"
|
||||
#include "pimutex.h"
|
||||
|
||||
|
||||
class PIEthernet;
|
||||
@@ -37,7 +37,6 @@ class PIStreamPacker;
|
||||
namespace PICloud {
|
||||
|
||||
|
||||
|
||||
class PIP_CLOUD_EXPORT TCP {
|
||||
public:
|
||||
enum Version {
|
||||
@@ -47,21 +46,21 @@ public:
|
||||
|
||||
enum Role {
|
||||
InvalidRole = 0,
|
||||
Server = 1,
|
||||
Client = 2,
|
||||
Server = 1,
|
||||
Client = 2,
|
||||
};
|
||||
|
||||
enum Type {
|
||||
InvalidType = 0,
|
||||
Connect = 1,
|
||||
Disconnect = 2,
|
||||
Data = 3,
|
||||
Ping = 4,
|
||||
Connect = 1,
|
||||
Disconnect = 2,
|
||||
Data = 3,
|
||||
Ping = 4,
|
||||
};
|
||||
|
||||
TCP(PIStreamPacker * s);
|
||||
void setRole(Role r);
|
||||
Role role() const {return (Role)header.role;}
|
||||
Role role() const { return (Role)header.role; }
|
||||
void setServerName(const PIString & server_name_);
|
||||
PIString serverName() const;
|
||||
|
||||
@@ -82,8 +81,8 @@ private:
|
||||
struct Header {
|
||||
Header();
|
||||
uchar version; // PICloud::Version
|
||||
uchar type; // PICloud::Type
|
||||
uchar role; // PICloud::Role
|
||||
uchar type; // PICloud::Type
|
||||
uchar role; // PICloud::Role
|
||||
};
|
||||
|
||||
Header header;
|
||||
@@ -91,9 +90,8 @@ private:
|
||||
PIString server_name;
|
||||
PIStreamPacker * streampacker;
|
||||
PIMutex mutex_send;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace PICloud
|
||||
|
||||
#endif // PICLOUDTCP_H
|
||||
|
||||
Reference in New Issue
Block a user