Call after the connection is successful execution boost: : an asio: : async_read (socket, boost: : an asio: buffer (m_pPackBuffer, m_iGetLen), boost: : an asio: : transfer_all (), boost: : bind (& amp; ClientSession: : onRead, shared_from_this (), boost: : an asio: : placeholders: : error, boost: : an asio: : placehoders: : bytes_transferred));
Each error after returning to the function, the error message () : error code 10014, the system detected in a single call trying to use the pointer parameter is invalid pointer address
Void ClientSession: : onRead (const boost: : system: : error_code & amp; The error, size_t bytes_transferred)
{
if(! The error)
{
TcpClient - & gt; OnMessage (m_pPackBuffer bytes_transferred) (int);
Boost: : an asio: : async_read (socket, boost: : an asio: buffer (m_pPackBuffer, m_iGetLen), boost: : an asio: : transfer_all (), boost: : bind (& amp; ClientSession: : onRead, shared_from_this (), boost: : an asio: : placeholders: : error, boost: : an asio: : placehoders: : bytes_transferred));
}
The else
{
HandleProcException (the error message ());
return;
}
}
What reason be excuse me, how to solve?
CodePudding user response:
Online, etc., the first to solve the problem of high scores!CodePudding user response:
The interpretation of the MSDN10014 Bad WSAEFAULT address.
The system detected an invalid pointer address in attempting to use a pointer argument of a call. This error occurs if The an application passes The an invalid pointer value, or if The length of The buffer is too small, For instance, if The length of an argument, which is a sockaddr structure that is smaller than The sizeof (sockaddr).