Definition at line 40 of file sl_tcp_channel.cpp.
◆ TcpChannel()
sl::TcpChannel::TcpChannel |
( |
const std::string & |
ip, |
|
|
int |
port |
|
) |
| |
|
inline |
◆ bind()
bool sl::TcpChannel::bind |
( |
const std::string & |
ip, |
|
|
sl_s32 |
port |
|
) |
| |
|
inline |
◆ clearReadCache()
void sl::TcpChannel::clearReadCache |
( |
| ) |
|
|
inlinevirtual |
◆ close()
void sl::TcpChannel::close |
( |
| ) |
|
|
inlinevirtual |
◆ flush()
void sl::TcpChannel::flush |
( |
| ) |
|
|
inlinevirtual |
◆ getChannelType()
int sl::TcpChannel::getChannelType |
( |
| ) |
|
|
inlinevirtual |
◆ open()
bool sl::TcpChannel::open |
( |
| ) |
|
|
inlinevirtual |
◆ read()
int sl::TcpChannel::read |
( |
void * |
buffer, |
|
|
size_t |
size |
|
) |
| |
|
inlinevirtual |
Read data from the chanel
- Parameters
-
buffer | The buffer to receive data |
size | The size of the read buffer |
- Returns
- Bytes read (negative for read failure)
Implements sl::IChannel.
Definition at line 100 of file sl_tcp_channel.cpp.
◆ setStatus()
void sl::TcpChannel::setStatus |
( |
_u32 |
flag | ) |
|
|
inline |
◆ waitForData()
bool sl::TcpChannel::waitForData |
( |
size_t |
size, |
|
|
sl_u32 |
timeoutInMs, |
|
|
size_t * |
actualReady |
|
) |
| |
|
inlinevirtual |
Wait for some data
- Parameters
-
size | Bytes to wait |
timeoutInMs | Wait timeout (in microseconds, -1 for forever) |
actualReady | [out] actual ready bytes |
- Returns
- true for data ready
Implements sl::IChannel.
Definition at line 87 of file sl_tcp_channel.cpp.
◆ waitForDataExt()
sl_result sl::TcpChannel::waitForDataExt |
( |
size_t & |
size_hint, |
|
|
sl_u32 |
timeoutInMs |
|
) |
| |
|
inlinevirtual |
Wait for some data
- Parameters
-
size_hint | Byte count may available to retrieve without beening blocked |
timeoutInMs | Wait timeout (in microseconds, -1 for forever) |
- Returns
- RESULT_OK if there is data available for receiving RESULT_OPERATION_TIMEOUT if the given timeout duration is exceed RESULT_OPERATION_FAIL if there is something wrong with the channel
Implements sl::IChannel.
Definition at line 72 of file sl_tcp_channel.cpp.
◆ write()
int sl::TcpChannel::write |
( |
const void * |
data, |
|
|
size_t |
size |
|
) |
| |
|
inlinevirtual |
Send data to remote endpoint
- Parameters
-
data | The data buffer |
size | The size of data buffer (in bytes) |
- Returns
- Bytes written (negative for write failure)
Implements sl::IChannel.
Definition at line 95 of file sl_tcp_channel.cpp.
◆ _binded_socket
◆ _ip
std::string sl::TcpChannel::_ip |
|
private |
◆ _port
int sl::TcpChannel::_port |
|
private |
◆ _socket
The documentation for this class was generated from the following file: