![]() The above mentioned sample code is provided to you as is with no representations, warranties or conditions of any kind. You may use, modify and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the sample code may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property (b) it may not be possible to make the sample code fully functional and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the sample code. In no event should the code be used to support ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SAMPLE CODE, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Although the copyright in the code belongs to Citrix, any distribution of the sample code should include only your own standard copyright attribution, and not that of Citrix. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the sample code.Both the approaches are valid ones. What you have is simply a synchronous operation and asynchronous operation. sockets has both modes available for many years so do e.g. The choice boils down to this - whether or not your client program can afford to wait for the operation to finish or not. If it can, synchronous operations are simpler to program. ![]() Else do asynchronous model with callbacks.Īs far as retries go - that again depends. Retry for how long? Many programs simply try 2-3 times in a loop on failure. If your retry is of the type that retry after certain times, then you have to store information about what you are trying to do somewhere. That somewhere could be program memory, or some permanent storage. Both synchronous and asynchronous modes would require information storage for retries. Asynchronous more so because when you get a call back you need to check your store to figure out what you were attempting to do. In synchronous mode that information is many a times implicitly stored in the program stack, in for of the data variables. Then also should retries survive program crashes? If so then you need to store the information in some offline store. I once had a telecom app that telecom app would write a call detail record to a DB. If for some reason that failed, the program would simply write that CDR into a local file, and move on. A cron job would come and clean up the records in the local file by sending them to DB.
0 Comments
Leave a Reply. |