Netduino 3 Ethernet & M2MQTT

I am trying to port some code that works fine on NP2 to Netduino 3 Ethernet. The code relies on the M2MQTT implementation of the MQTT messaging protocol. It compiles fine but when I run it on N3E, it fails at the following line within M2MQtt:
this.socket.Connect(new IPEndPoint(this.remoteIpAddress, this.remotePort)); It looks like the N3E firmware does not support IPEndPoint . Is this possible? According to Intellisense, the only available form for socket.Connect() requires IPEndPoint… is there a way around this?
Thanks -

I found the problem. It had nothing to do with IPEndPoint. M2MQtt uses Environment.TickCount but Netduino 3 Ethernet doesn’t support it (Netduino Plus 2 does support it however). A similar situation is documented here: where the author says, “If you still want to use the library replace all “Environment.TickCount” with “(Int32)(DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond)”. There are 11 replacements to be done. After this the M2Mqtt library works fine.”
Worked for me.

Fixing the TickCount problem let it run for a minute or two but then an “index out of bounds” error pops up in the depths of MQTT. The exact same code runs forever on Netduino Plus 2. I give up on Netduino 3 Ethernet.