You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-06-13 16:01:32 +03:00
Reformat all code to coding standard
This commit is contained in:
@ -40,57 +40,58 @@ using namespace std;
|
||||
#include "iosocket.h"
|
||||
#undef IOSOCKET_DLLEXPORT
|
||||
|
||||
namespace messageqcpp {
|
||||
namespace messageqcpp
|
||||
{
|
||||
|
||||
IOSocket::IOSocket(Socket* socket) :
|
||||
fSocket(socket), sockID(0)
|
||||
fSocket(socket), sockID(0)
|
||||
{
|
||||
memset(&fSa, 0, sizeof(fSa));
|
||||
memset(&fSa, 0, sizeof(fSa));
|
||||
}
|
||||
|
||||
IOSocket::~IOSocket()
|
||||
{
|
||||
delete fSocket;
|
||||
delete fSocket;
|
||||
}
|
||||
|
||||
void IOSocket::doCopy(const IOSocket& rhs)
|
||||
{
|
||||
fSocket = rhs.fSocket->clone();
|
||||
fSa = rhs.fSa;
|
||||
sockID = rhs.sockID;
|
||||
fSocket = rhs.fSocket->clone();
|
||||
fSa = rhs.fSa;
|
||||
sockID = rhs.sockID;
|
||||
}
|
||||
|
||||
IOSocket::IOSocket(const IOSocket& rhs)
|
||||
{
|
||||
doCopy(rhs);
|
||||
doCopy(rhs);
|
||||
}
|
||||
|
||||
IOSocket& IOSocket::operator=(const IOSocket& rhs)
|
||||
{
|
||||
if (this != &rhs)
|
||||
{
|
||||
delete fSocket;
|
||||
doCopy(rhs);
|
||||
}
|
||||
if (this != &rhs)
|
||||
{
|
||||
delete fSocket;
|
||||
doCopy(rhs);
|
||||
}
|
||||
|
||||
return *this;
|
||||
return *this;
|
||||
}
|
||||
|
||||
const string IOSocket::toString() const
|
||||
{
|
||||
#ifdef NOSSTREAM
|
||||
return "IOSocket";
|
||||
return "IOSocket";
|
||||
#else
|
||||
ostringstream oss;
|
||||
char buf[INET_ADDRSTRLEN];
|
||||
SocketParms sp = fSocket->socketParms();
|
||||
const sockaddr_in* sinp = reinterpret_cast<const sockaddr_in*>(&fSa);
|
||||
oss << "IOSocket: sd: " << sp.sd() <<
|
||||
ostringstream oss;
|
||||
char buf[INET_ADDRSTRLEN];
|
||||
SocketParms sp = fSocket->socketParms();
|
||||
const sockaddr_in* sinp = reinterpret_cast<const sockaddr_in*>(&fSa);
|
||||
oss << "IOSocket: sd: " << sp.sd() <<
|
||||
#ifndef _MSC_VER
|
||||
" inet: " << inet_ntop(AF_INET, &sinp->sin_addr, buf, INET_ADDRSTRLEN) <<
|
||||
" inet: " << inet_ntop(AF_INET, &sinp->sin_addr, buf, INET_ADDRSTRLEN) <<
|
||||
#endif
|
||||
" port: " << ntohs(sinp->sin_port);
|
||||
return oss.str();
|
||||
" port: " << ntohs(sinp->sin_port);
|
||||
return oss.str();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user