We have a custom built micro PC that is connecting to home base using WiFi. We are using the Zentri WiFi module which comes with its own TCP stack. Connection to the server is done using HTTP on port 8087. The micro PC also includes a GSM module that is used to connect to the same server when not in WiFi range.
Server: Linux / Apache / PHP
Request to server is a simple POST request - data in - PHP script processes and sends a response.
Everything works fine up until the response. When connecting over WiFi we don't see the return. POST data is received by the PHP script and entered into the database - so that side is fine. The return buffer however is not "seen" by the WiFi module. All other means to connect to the server work as expected (Browser, C/C++ test program, GSM module) - no issues.
We suspected it might be a timing issue so we added a 1 second sleep() in the PHP script immediately after output of the return buffer - this works - the Zentri module "sees" the response.
It seems that what is happening is that Apache is sending the buffer and then issuing a close() - and the client is seeing the close and ignoring the buffer.
My question is - is it possible that there is something we are not doing in our code - some option that is not being set / is being set that would cause this - that other systems might be more lenient about or is the most likely scenario a bad TCP/IP implementation?