Hi,
The port to write to socket should be masked and bit shift instead of dividing and modulus.
// Send port
//SocketWriteByte((byte)(ConnectionInfo.Port / 0xFF));
//SocketWriteByte((byte)(ConnectionInfo.Port % 0xFF));
// Mask & bit shift, not divide or modulus
SocketWriteByte((byte)((ConnectionInfo.Port & 0xFF00) >> 8));
SocketWriteByte((byte)(ConnectionInfo.Port & 0xFF));
Thanks.
The port to write to socket should be masked and bit shift instead of dividing and modulus.
// Send port
//SocketWriteByte((byte)(ConnectionInfo.Port / 0xFF));
//SocketWriteByte((byte)(ConnectionInfo.Port % 0xFF));
// Mask & bit shift, not divide or modulus
SocketWriteByte((byte)((ConnectionInfo.Port & 0xFF00) >> 8));
SocketWriteByte((byte)(ConnectionInfo.Port & 0xFF));
Thanks.