I did fix the webserver and out going web client both working at the same time.
I made a few changes in the WIFIClient.cpp code in the Arduino Libraries directory.
void WiFiClient::disconnect() {
if (_sock == 255)
return;
ServerDrv::stopClient(_sock);
int count = 0;
// wait maximum 5 secs for the connection to close
while (status() != CLOSED && ++count < 50)
delay(100);
}
Then in your Arduino Sketch WebServer when you are done with the Accepted Socket.
Do:
clientAccept.flush();
clientAccept.disconnect();
DO NOT DO clientAccept.stop(); that is the in the sample code.
I still get the WIFIServer Listen giving a status of 0 randomly after some time.