Pointer to Print Class (DualWriter) / TelnetServer [solved]

Hi, thanks for the praise, I like helping out.

I realize now why the original code didn't work, also, the original code is the one you want to use, if you weren't doing so.
I'll explain why.

Firstly you are best to initialize the ethernet client like this:

EthernetClient ethTelnet_Client;

The reason that assigning 0 didn't work, i.e:

EthernetClient ethTelnet_Client = 0;

Is because this set the internal socket to 0, which is a valid socket number.
The default constructor sets the socket to MAX_SOCK_NUM, and this value is used in the class to decide weather to react to calls that use a real socket.

This is why using an ' anonymous temporary' object worked, i.e:

EthernetClient ethTelnet_Client = EthernetClient();

This works due to the default constructor in the anonymous temporary setting MAX_SOCK_NUM, then simply passing it on to your object.

So you can safely use the version below as well, but is implicitly done if left to do so.

EthernetClient ethTelnet_Client = MAX_SOCK_NUM;

So it was this reason my original version seemed to fail, where It was actually incorrect initialization. :stuck_out_tongue: