I have a working B2B web service that uses YAJL. It works correct for small incoming JSON payloads. The only problem is that the connection remains open while the program processes large payloads, which have thousands of line items that take several minutes to process, which causes a timeout.
My code essentially does a version of these commands to send an acknowledgement of the request:
yajl_genOpen(*off);
yajl_beginObj();
yajl_addBool('success': true);
yajl_endObj();
yajl_writeStdout(200 : errMsg);
yajl_genClose();
I was expecting the socket to close during yajl_genClose(), but it doesn't close until the program ends. After the yajl_genClose function runs, the program processes the incoming JSON in what I am expecting to be "offline batch mode" since I (tried to) close the socket.
I've seen this code that can close the socket manually, but that requires having a handle to the socket. Scott's YAJL routines internalize the socket handle, and I don't see a function in his code to retrieve it.
How do I force-close the socket using YAJL?
Thanks
My code essentially does a version of these commands to send an acknowledgement of the request:
yajl_genOpen(*off);
yajl_beginObj();
yajl_addBool('success': true);
yajl_endObj();
yajl_writeStdout(200 : errMsg);
yajl_genClose();
I was expecting the socket to close during yajl_genClose(), but it doesn't close until the program ends. After the yajl_genClose function runs, the program processes the incoming JSON in what I am expecting to be "offline batch mode" since I (tried to) close the socket.
I've seen this code that can close the socket manually, but that requires having a handle to the socket. Scott's YAJL routines internalize the socket handle, and I don't see a function in his code to retrieve it.
Code:
D close PR 10I 0 ExtProc('close') D sock_desc 10I 0 value C callp close(s)
How do I force-close the socket using YAJL?
Thanks
Comment