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.
Comments: ** Comment from web user: ShienIkiru **
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.
Comments: ** Comment from web user: ShienIkiru **
This should be treated as URGENT.
I realize this when using port 443, and sending 444 instead and so I use 256 instead of 0xff. But your code seem the proper way.