You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the function Server::recvall line 5, the code is
int RetnCheck = recv(connections[ID]->socket, data, totalbytes - bytesreceived, NULL); //Try to recv remaining bytes
,There is pass the buffer as the argv to the recv function directly, If only call the recv funciont one time, it's no problem, but when called the recv funcion twice or more, the buffer pass to the recv function will be overwrite and lost data, there should pass the buffer add the bytesreceived to the recv function, like this:
int RetnCheck = recv(connections[ID]->socket, data + bytesreceived, totalbytes - bytesreceived, NULL); //Try to recv remaining bytes
The text was updated successfully, but these errors were encountered:
In the function Server::recvall line 5, the code is
int RetnCheck = recv(connections[ID]->socket, data, totalbytes - bytesreceived, NULL); //Try to recv remaining bytes
,There is pass the buffer as the argv to the recv function directly, If only call the recv funciont one time, it's no problem, but when called the recv funcion twice or more, the buffer pass to the recv function will be overwrite and lost data, there should pass the buffer add the bytesreceived to the recv function, like this:
int RetnCheck = recv(connections[ID]->socket, data + bytesreceived, totalbytes - bytesreceived, NULL); //Try to recv remaining bytes
The text was updated successfully, but these errors were encountered: