49 lines
611 B
C++
49 lines
611 B
C++
#include "Socket.h"
|
|
|
|
Socket::Socket()
|
|
: mPort(8888),
|
|
mMessage(),
|
|
mHandle(-1)
|
|
{
|
|
|
|
}
|
|
|
|
Socket::~Socket()
|
|
{
|
|
|
|
}
|
|
|
|
void Socket::SetHandle(SocketHandle handle)
|
|
{
|
|
mHandle = handle;
|
|
}
|
|
|
|
Socket::SocketHandle Socket::GetHandle() const
|
|
{
|
|
return mHandle;
|
|
}
|
|
|
|
std::unique_ptr<Socket> Socket::Create()
|
|
{
|
|
return std::make_unique<Socket>();
|
|
}
|
|
|
|
std::string Socket::GetMessage() const
|
|
{
|
|
return mMessage;
|
|
}
|
|
|
|
void Socket::SetMessage(const std::string& message)
|
|
{
|
|
mMessage = message;
|
|
}
|
|
|
|
void Socket::SetPort(unsigned port)
|
|
{
|
|
mPort = port;
|
|
}
|
|
|
|
unsigned Socket::GetPort() const
|
|
{
|
|
return mPort;
|
|
}
|