I set a receiving timeout to 10 seconds. If I run a query “select pg_sleep(15)”, how can I increase the current timeout enough that the query execution to be fulfilled? Or, worse: what if the current connection is broken after 8 seconds, for example? For now, I set this timeout to one million miliseconds, but in case of connection issues or any other errors the end user have to wait until execution is done and our client application has hang as well (not responding).
I tried to adapt the PhotoServer project and I made the following steps:
-After upload photo I deactivated the photo listing on client
-On server, in TPhotoServerService.UploadPhoto I added a 10 second sleep
Uploading photo to server processes only 2 requests in parallel. If I’m starting uploading 10 photos (pressing 10 times Upload), the first two photos are uploaded and the third request is waiting to terminate previous 2 uploads.
In my opinion starting 10 async requests must be processed on server almost simultaneously.
What are the limitations, is there any alternative solution?
This sample uses plain http channel (TROWinInetHTTPChannel). this is non-async channel. so each BeginUploadPhoto call is performed consistently, i.e. each next upload will be performed after previous upload will be finished.
workarounds:
use super channel (SuperTCP or SuperHTTP) for true asynchronous calls.
create a new TROWinInetHTTPChannel instance for each asynchronous call.