SpiecsEngine
 
Loading...
Searching...
No Matches

◆ Receive()

std::string Spices::Net::Socket::Receive ( ) const

Receive data from server.

Returns
Returns received data.
Note
Usually not call Receive directly, but use Buffer::ReadFd.

Definition at line 119 of file Socket.cpp.

120 {
122
123 char buffer[1024];
124 int bytes = ::recv(m_SocketFd, buffer, sizeof(buffer), 0);
125 if(bytes < 0)
126 {
127 std::stringstream ss;
128 ss << "Socket::Receive error, socket fd: " << m_SocketFd << " Error: " << WSAGetLastError();
129
130 SPICES_CORE_CRITICAL(ss.str())
131 }
132
133 return std::string(buffer, bytes);
134 }
#define SPICES_PROFILE_ZONE
SOCKET m_SocketFd
This socket fd.
Definition Socket.h:142