Did you write that function yourself?
Yes. It didn't take much with the Arduino library. I am very familiar with it now.
Here are the additions:
In /libraries/Ethernet/client.cpp, add this. I put it after the Client::available() function.
uint8_t Client::remoteIP(uint8_t *buf) {
if (_sock != MAX_SOCK_NUM)
return W5100.readSnDIPR(_sock,buf);
return 0;
}
In /libraries/Ethernet/client.h, add this. I again put it after the declaration for available().
virtual uint8_t remoteIP(uint8_t *buf);
Then use it like this after the client.connect() or client.connected():
byte ipBuffer[4];
char outBuffer[18];
client.remoteIP(ipBuffer);
sprintf(outBuffer,"%u.%u.%u.%u\r\n",ipBuffer[0],ipBuffer[1],ipBuffer[2],ipBuffer[3]);