10 #ifdef __TARGET_OS__Windows 18 #ifdef __TARGET_OS__Windows 26 #ifdef __TARGET_OS__Windows 27 Tcp(SOCKET _idSocket,
const std::string& _name);
29 Tcp(int32_t _idSocket,
const std::string& _name);
34 Tcp& operator= (
Tcp&& _obj);
36 Tcp& operator= (
Tcp& _obj) =
delete;
79 int32_t
read(
void* _data, int32_t _maxLen);
87 int32_t
write(
const void* _data, int32_t _len);
95 int32_t
write(
const std::string& _data,
bool _writeBackSlashZero =
true) {
96 if (_data.size() == 0) {
99 if (_writeBackSlashZero ==
true) {
100 return write(_data.c_str(), _data.size()+1);
102 return write(_data.c_str(), _data.size());
112 int32_t
write(
const std::vector<T>& _data) {
113 if (_data.size() == 0) {
116 size_t ret =
write(&_data[0], _data.size()*
sizeof(T));
120 return ret/
sizeof(T);
123 bool setTCPNoDelay(
bool _enabled);
const std::string & getName()
Get the decriptive name hot the host:port.
Definition: Tcp.hpp:45
int32_t write(const std::vector< T > &_data)
Write a chunk of data on the socket.
Definition: Tcp.hpp:112
enum status getConnectionStatus() const
Get the current Status of the connection.
Definition: Tcp.hpp:62
int32_t write(const std::string &_data, bool _writeBackSlashZero=true)
Write a chunk of data on the socket.
Definition: Tcp.hpp:95
int32_t write(const void *_data, int32_t _len)
Write a chunk of data on the socket.
int32_t read(void *_data, int32_t _maxLen)
Read a chunk of data on the socket.
Main esvg namespace.
Definition: enet.hpp:17