Hi. I have a client that connects to a server and attempts to send the number 400 to the server, that goes well.
int Send(SOCKET socket,int _buffer )
{
send( socket, reinterpret_cast< char * >( &_buffer ), sizeof( _buffer ) , 0 );
Logger.LogInt(_buffer); // Log to make sure i sent the right number
if (nret == SOCKET_ERROR) {
return NETWORK_ERROR;
}
else{}
}
However, instead of 400, the server is receving 249, i checked this after multiple tests via my log file. Here is the servers recv function:
int Recv(SOCKET socket)
{
char buffer[256];
int _buffer;
nret = recv( socket, reinterpret_cast< char * >( &_buffer ), sizeof( _buffer ) , 0 );
_buffer = iShiptwo_x;
Logger.LogInt(iShiptwo_x); // log what i recieved!
if (nret == SOCKET_ERROR) {
// Get a specific code
// Handle accordingly
return NETWORK_ERROR;
} else {
}
}
If any one has an idea on whats going on, that'd be great, thanks.