troubleshooting Question

TCP/IP Socket - connection close results in data lost

Avatar of Julian Hansen
Julian HansenFlag for South Africa asked on
CC++Apache Web ServerTCP/IP
14 Comments4 Solutions426 ViewsLast Modified:
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?
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 4 Answers and 14 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 4 Answers and 14 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros