Problem on calling function on WIFI Shield

Hello

I have a problem using functions on WIFI Shield.
I attached two sketchs, one is working (WiFiWebClient2working.ino).
I put send messages and receive data in two functions whose parameter is the WiFi client (except in the send function that works).
The behavior of the sketc that does not work is:

  • data are sent and handled by remote side;
  • date aren’t received from remote side because client.connected == false;
  • besides, and this is the thing that seems most strange; the client.connected is true for the WiFi client () passed in parameters, and false for the WiFi client () external

Writing these notes, I realized that the problem is probably in the passage of the object WiFiClient, but I have no idea how to do.
Thanks for suggestions.

John Rossati

WiFiWebClient2notworking.ino (3.67 KB)

WiFiWebClient2working.ino (3.48 KB)