add socket move
This commit is contained in:
@@ -91,7 +91,8 @@ DataBuffer TcpSocket::Read(std::size_t a_Amount) {
|
||||
std::size_t totalRecieved = 0;
|
||||
|
||||
while (totalRecieved < a_Amount) {
|
||||
int recvAmount = recv(m_Handle, reinterpret_cast<char*>(buffer.data() + totalRecieved), static_cast<int>(a_Amount - totalRecieved), 0);
|
||||
int recvAmount =
|
||||
recv(m_Handle, reinterpret_cast<char*>(buffer.data() + totalRecieved), static_cast<int>(a_Amount - totalRecieved), 0);
|
||||
if (recvAmount <= 0) {
|
||||
#if defined(_WIN32) || defined(WIN32)
|
||||
int err = WSAGetLastError();
|
||||
@@ -150,8 +151,10 @@ void TcpSocket::Disconnect() {
|
||||
m_Status = Status::Disconnected;
|
||||
}
|
||||
|
||||
|
||||
TcpSocket& TcpSocket::operator=(IOInterface&& a_Other) {
|
||||
std::swap(m_Handle, a_Other.m_Handle);
|
||||
std::swap(m_Status, a_Other.m_Status);
|
||||
}
|
||||
|
||||
} // namespace io
|
||||
|
||||
} // namespace sp
|
||||
|
||||
Reference in New Issue
Block a user