Hi, quick question on a weird behavior when checking a boolean:
I have a TcpClient socket where I turn off Nagle’s algorithm by setting “TcpClient.NoDelay = true”
It seems to work and everything, which is great, but the weird part is if I go to check the returned value of TcpClient.NoDelay I am getting a “InvalidCastException: Cannot cast from source type to destination type.”
This does not work:
myTcpClient.NoDelay = true;
Debug.Log ("Check TcpClient.NoDelay: " + myTcpClient.NoDelay); // Causes: InvalidCastException: Cannot cast from source type to destination type.
This does work by checking NoDelay directly from myTcpClient’s underlying socket:
myTcpClient.NoDelay = true;
Debug.Log ("Check Socket.NoDelay: " + myTcpClient.Client.NoDelay);
For your convenience, here’s the MSDN pages for the TcpClient and Socket class’s NoDelay function:
Should I be asking this question on stackoverflow instead? I thought to ask here first because it seems like some weird C# Mono implementation issue.
Thanks!