I have an Arduino UNO and ENC28J60 pcb. I'm using the UIPEthernet library and have the TcpServer working. It accepts up to 4 TCP clients, and echos each one's data back separately. (4 is the limit, 5th client fails to connect.)
In my application I have 4 streams of data and want to feed one to each of the connected clients, so TcpServer_main needs to be able to identify the 4 clients. So I need a var in the client, set to the number of the client.
Now my understanding of the ++ part of C++ limits me. In UIPClient.h 'class UIPClient : public Client'" I've added 'int client_ix;' and in TcpServer_main I can refer to it with client.client_ix. I need to set it to unique number, or init it to e.g. -1 so main can see it's a new one.
I've tried various places in UIPClient.h or .cpp, but either nothing happens, or it only inits for the first server, or it inits with every connection.
Any help appreciated.