SpiecsEngine
Loading...
Searching...
No Matches
◆
ReadFd()
size_t Spices::Net::Buffer::ReadFd
(
SOCKET
fd
,
int *
saveErrno
)
Read from
Socket
.
Parameters
[in]
fd
SOCKET.
[in,out]
saveErrno
Error value.
Returns
Returns read bytes.
Note
read api can only be used in linux, on windows use recv instead,
Definition at line
53
of file
Buffer.cpp
.
54
{
55
char
buffer[65536] = {};
// 64k
56
57
int
n = ::recv(fd, buffer,
sizeof
(buffer), 0);
58
59
if
(n < 0)
60
{
61
*saveErrno = WSAGetLastError();
62
}
63
else
64
{
65
const
std::string str(buffer, n);
66
Append
(str.c_str(), str.size());
67
}
68
69
return
n;
70
}
Spices::Net::Buffer::Append
void Append(const std::string &msg)
Append Message to this buffer.
Definition
Buffer.cpp:41
References
Append()
.
Spices
Net
Buffer
Generated on Sun Mar 8 2026 10:24:50 for SpiecsEngine by
1.10.0