[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: senddoc() error... "SetError() #55: blockwrite: send: Broken pipe..



   Perhaps, this issue is related to the error and suggested bugfix that I
   posted back in August 2013 "MCH0601 in SendDoc at 4523 (v1.24)".
   This is how I produced the error and how I fixed SendDoc():
   In order to reproduce the error you may:
   a) Add a breakpoint to the first line of SendDoc().
   b) Call your test program.
   c) Shutdown your (test) web server or wait for a timeout (broken pipe).
   d) Let the program continue.
   Now wwLeft is incremented whereas wwPos is decremented and it is just a
   question
   of time until MCH0601 is sent. For now I fixed the problem like this:
       c                   eval      wwSent = comm_BlockWrite( peComm
       c                                                     : wwPos
       c                                                     : wwChunk
       c                                                     : peTimeout )
        *  Monitor return code of comm_BlockWrite()
       c                   if        wwSent < 0
       c                   return    -1
       c                   endif
       c                   eval      wwLeft = wwLeft - wwSent
   Thomas.
   ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx schrieb am 06.01.2014 23:21:59:
   > Von: sk@xxxxxxxxxxxxxxxx
   > An: ftpapi@xxxxxxxxxxxxxxxxxxxxxx,
   > Datum: 06.01.2014 23:55
   > Betreff: Re: senddoc() error... "SetError() #55: blockwrite: send:
   > Broken pipe..
   > Gesendet von: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   >
   > Ouch.  Well, that's not good.
   >
   > Can you tell me how to reproduce this on my own machine so I can
   debug it?
   >
   >
   > On 1/6/2014 12:16 PM, Gerald Magnuson wrote:
   > > Thanks...
   > > I think I am having trouble before I get the return back from
   httpapi...
   > >
   > > Here is what I send:
   > >
   > >         rc=http_url_post(
   > >
   'http://caesar.knapheide.com/corpsystemsalestaxaddressvalidation/'
   > >                             :%addr(data)
   > >                             :%len(%trimr(data))
   > >                             :'/tmp/STAX/' + %trim(XMLout) )   ;
   > >     if        rc <> 1
   > >     eval      ErrMsgA = http_error
   > >     eval      %subst(ErrMsgA:55:15) = XMLout
   > >     return    ErrMsgA
   > >     Else
   > >     eval      ErrMsgA = 'Validate OK'
   > >
   > >
   > > but my program doesn't error until I get:
   > >
   > >  From module . . . . . . . . :   HTTPAPIR4
   > >  From procedure  . . . . . . :   SENDDOC
   > > Statement . . . . . . . . . :   4600
   > > To module . . . . . . . . . :   HTTPAPIR4
   > > To procedure  . . . . . . . :   SENDDOC
   > > MCH0601   :   Space offset X'00000000' or X'0000000000000000' is
   outside
   > >     current limit for object OEW6KGS1  KBECKMAN  121994.
   > >
   > >
   > >
   > > My debug file has:
   > > HTTPAPI Ver 1.24 released 2012-01-23
   > > OS/400 Ver V7R1M0
   > >
   > > http_url_post(): entered
   > > http_persist_open(): entered
   > > http_long_ParseURL(): entered
   > > DNS resolver retrans: 4
   > > DNS resolver retry  : 4
   > > DNS resolver options: x'00000136'
   > > DNS default domain: knapheide.com
   > > DNS server found: 192.168.100.236
   > > DNS server found: 192.168.100.233
   > > http_persist_post(): entered
   > > http_persist_req(POST) entered.
   > > http_long_ParseURL(): entered
   > > do_oper(POST): entered
   > > There are 0 cookies in the cache
   > > POST /corpsystemsalestaxaddressvalidation/ HTTP/1.1
   > > POST /corpsystemsalestaxaddressvalidation/ HTTP/1.1
   > > Host: caesar.knapheide.com
   > > User-Agent: http-api/1.24
   > > Content-Type: text/xml
   > > Content-Length: 489
   > >
   > >
   > > senddoc(): entered
   > > SetError() #55: blockwrite: send: Broken pipe.
   > > <<<<<above line repeated 29,000 times>>>
   > >
   > >
   > >
   > >
   > >
   > > Gerald Magnuson
   > >
   > >
   > > -----Original Message-----
   > > From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [[1]mailto:ftpapi-
   > bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Scott Klement
   > > Sent: Monday, January 06, 2014 11:39 AM
   > > To: HTTPAPI and FTPAPI Projects
   > > Subject: Re: senddoc() error... "SetError() #55: blockwrite: send:
   > Broken pipe..
   > >
   > > Gerald,
   > >
   > > This error means that the HTTP session was disconnected before it
   > was able to completely send your data to the server you are
   > communicating with.
   > >
   > > You can check for this (and all other errors) by checking the
   > return value from the HTTPAPI procedure that you are calling.  Any
   > number lower
   > > than 1 indicates failure.   Once you discover that it has failed,
   you
   > > can call http_error() to get the error message and error number
   > that occurred.
   > >
   > > -SK
   > >
   > >
   > > On 1/6/2014 11:07 AM, Gerald Magnuson wrote:
   > >>      We get this a couple of times a week...
   > >>
   > >>
   > >>      Is there something I can do to check for this???
   > >>
   > >>
   > >>
   > >>      Gerald Magnuson
   > >>
   > >>
   > >>
   > >>
   ----------------------------------------------------------------------
   > >> - This is the FTPAPI mailing list.  To unsubscribe, please go to:
   > >> [2]http://www.scottklement.com/mailman/listinfo/ftpapi
   > >>
   ----------------------------------------------------------------------
   > >> -
   > >
   -----------------------------------------------------------------------
   > > This is the FTPAPI mailing list.  To unsubscribe, please go to:
   > > [3]http://www.scottklement.com/mailman/listinfo/ftpapi
   > >
   -----------------------------------------------------------------------
   > >
   >
   >
   -----------------------------------------------------------------------
   > This is the FTPAPI mailing list.  To unsubscribe, please go to:
   > [4]http://www.scottklement.com/mailman/listinfo/ftpapi
   >
   -----------------------------------------------------------------------

   --
   IMPORTANT NOTICE:
   This email is confidential, may be legally privileged, and is for the
   intended recipient only. Access, disclosure, copying, distribution, or
   reliance on any of it by anyone else is prohibited and may be a
   criminal
   offence. Please delete if obtained in error and email confirmation to
   the sender.

References

   1. mailto:ftpapi-
   2. http://www.scottklement.com/mailman/listinfo/ftpapi
   3. http://www.scottklement.com/mailman/listinfo/ftpapi
   4. http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------