mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-04-23 07:05:36 +03:00
62 lines
1.9 KiB
C++
62 lines
1.9 KiB
C++
/* Copyright (C) 2014 InfiniDB, Inc.
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU General Public License
|
|
as published by the Free Software Foundation; version 2 of
|
|
the License.
|
|
|
|
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 General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
|
MA 02110-1301, USA. */
|
|
|
|
/***********************************************************************
|
|
* $Id$
|
|
*
|
|
*
|
|
***********************************************************************/
|
|
/** @file */
|
|
#pragma once
|
|
|
|
#include <unistd.h>
|
|
#include <netinet/in.h>
|
|
|
|
#include "socket.h"
|
|
#include "iosocket.h"
|
|
#include "bytestream.h"
|
|
#include "inetstreamsocket.h"
|
|
#include "idbcompress.h"
|
|
|
|
namespace messageqcpp
|
|
{
|
|
class CompressedInetStreamSocket : public InetStreamSocket
|
|
{
|
|
public:
|
|
CompressedInetStreamSocket();
|
|
CompressedInetStreamSocket(const CompressedInetStreamSocket&) = default;
|
|
virtual ~CompressedInetStreamSocket(){};
|
|
|
|
using InetStreamSocket::operator=;
|
|
virtual Socket* clone() const;
|
|
virtual const SBS read(const struct timespec* timeout = 0, bool* isTimeOut = NULL,
|
|
Stats* stats = NULL) const;
|
|
virtual void write(const ByteStream& msg, Stats* stats = NULL);
|
|
virtual void write(SBS msg, Stats* stats = NULL);
|
|
virtual const IOSocket accept(const struct timespec* timeout);
|
|
virtual void connect(const sockaddr* addr);
|
|
|
|
private:
|
|
std::shared_ptr<compress::CompressInterface> alg;
|
|
bool useCompression;
|
|
static const uint32_t HEADER_SIZE = 4;
|
|
};
|
|
|
|
} // namespace messageqcpp
|
|
|
|
#undef EXPORT
|