49#ifndef LASS_GUARDIAN_OF_INCLUSION_IO_SOCKET_H
50#define LASS_GUARDIAN_OF_INCLUSION_IO_SOCKET_H
66class SocketError:
public util::ExceptionMixin<SocketError>
69 SocketError(std::string msg, std::string loc): util::ExceptionMixin<SocketError>(std::move(msg), std::move(loc)) {}
70 ~SocketError() noexcept {}
79 typedef unsigned short TPort;
87 void bind(TPort port = 0);
88 void bind(
const std::string& address, TPort port = 0);
90 TPort
bindInRange(
const std::string& address, TPort begin, TPort end);
92 void accept(Socket& oConnection)
const;
93 void connect(
const std::string& address, TPort port);
95 std::string address()
const;
98 int send(
const void* begin,
int length)
const;
99 const void* send(
const void* begin,
const void* end)
const;
100 int receive(
void* begin,
int length)
const;
101 void* receive(
void* begin,
void* end)
const;
103 int sizeSendBuffer()
const;
105 void swap(Socket& other);
108 impl::SocketImpl* pimpl_;
TPort bindInRange(TPort begin, TPort end)
Bind to the first available port in range [begin, end).
use as base class if derived should not be copyable
#define LASS_DLL
DLL interface: import or export symbols?
streams, binary streams, vrmlstreams, ...
Library for Assembled Shared Sources.