Socket 会话层
更多...
#include <rmvl/io/socket.hpp>
◆ Socket() [1/3]
◆ Socket() [2/3]
| rm::Socket::Socket |
( |
const Socket & | | ) |
|
|
delete |
◆ Socket() [3/3]
| rm::Socket::Socket |
( |
Socket && | other | ) |
|
|
inlinenoexcept |
◆ ~Socket()
◆ invalid()
| bool rm::Socket::invalid |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ read()
| std::string rm::Socket::read |
( |
| ) |
|
|
noexcept |
同步读取已连接的 Socket 中的数据(阻塞)
auto str = socket.read();
- 返回
- 使用
std::string 存储的读取到的数据
◆ write()
| bool rm::Socket::write |
( |
std::string_view | data | ) |
|
|
noexcept |
同步写入数据到已连接的 Socket 中(阻塞)
bool success = socket.write("Hello, World!");
- 参数
-
- 返回
- 是否写入成功
◆ _fd
该类的文档由以下文件生成: