Socket Timeout

Dougan778

New Member
Hey all,

I am developing an application that will communicate through a socket. I've got it all developed and it works well. However, I am having issues with the procedure hanging. In the logic, I have a "WAIT-FOR READ-RESPONSE OF hSocket." However, at this point I don't always receive anything from the other socket and since it is my client's job to terminate the connection, it hangs.

I am unable to find any way to set it to time out and still process received messages. Is there any way to do this? I'm using this .p as a backend to a webspeed process.
 
I had a similar problem with sockets and the process hanging because it's waiting.

So I put the Wait-for in-side a repeat block and added a Pause parameter to the wait-for.

i.e. WAIT-FOR READ-RESPONSE PAUSE 5. /* wait or pause 5 seconds */

Then at the top of the repeat block count how many times you have waited, then leave the repeat block if you think you have been waiting to long.

Hope this helps.
 
Back
Top