I'm currently using the TcpClient class from System.Net.Sockets and I'm wondering why the port is an int32 as actual port range goes from 0 to 65535 (ushort).
Asked
Active
Viewed 365 times
0
-
I looked at source code and didn't find anything directly. I suspect is is using common Trace Events routines which uses an integer as the key. The person who wrote the code probably found it required less casting to use an integer instead of a ushort. – jdweng Dec 10 '18 at 11:07
-
@jdweng Or, they simply did not want the `TcpClient` class to be [non-CLS-compliant](https://stackoverflow.com/a/3475755/11683). – GSerg Dec 10 '18 at 11:20