I'm working on a script that a server posts to us and we post to a server and theoretically is supposed to receive a response from the server and reply back to the server that posted to us. However sometimes the server I'm posting to doesn't respond. The big problem is the server that posted to us will assume the transaction went through successfully unless it hears otherwise. So essentially I need a way to send a response back to the first server if I never hear back from the server I'm posting to. I think register_shutdown_function could work for me but I don't know how to set that up so it only runs on error or whatever.
Thanks in advance