|
----- Original Message ----- From: "Scott Klement" <klemscot@klements.com> To: "RPG Liste" <rpg400-l@midrange.com> Sent: Friday, May 31, 2002 6:23 PM Subject: Re: auto flush option on send > > You shouldn't need to flush a socket. > > You didn't describe the problem that you're experiencing, but this might > be what you're seeing: > > I believe that the system will delay slightly before sending the data > after you call send(), in order to try to optimize the packets. If it can > get more data into each packet, then there are fewer packets to send, and > the process is more efficient. > > Remember, each packet can have up to 256 bytes of header data in it. If > you're only sending one byte of data in each packet, it's not very > efficient. > > Though, if you're passing large chunks of data when you call the send() > API, this probably isn't going to help you that much. So, if you want to > disable this optimization, you can use the TCP_NODELAY option in the > setsockopt() API. > > I'm not certain about the OS/400 TCP/IP stack, but some TCP/IP stacks will > force any pending output data to be sent as soon as you do a recv(). If > you're doing a recv() right after send your data (which is how most > network programs work) you don't need to flush anything, it gets done for > you. > > If none of that helps, then please post an explanation of the problem > you're trying to solve, along with code samples if possible... > Ok. Thanks. I try to describe my problem. We developed an Java program for creating customer orders over the internet. The java pgm's communicate over a socket connection with the rpg pgm's on the AS/400. But sometimes the RPG program does not send all bytes. The java pgm tries to read all bytes needed , in a loop. But in this case the loop never ends. It happens if two ore more entries in the basket. It seems as the buffer not correctly flushed. But what im wondering. If we start a service job and then debug the rpg pgm. Everything works fine. Should we offer a student job, which debugs every job ? :-) Hope you could understand my bad english. Thanks > > On Fri, 31 May 2002, Uwe Heldt wrote: > > > > Hi all, > > > > is it possible to flush an socket output stream with the rpg send command? > > > > Thanks > > _______________________________________________ > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > To post a message email: RPG400-L@midrange.com > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l > or email: RPG400-L-request@midrange.com > Before posting, please take a moment to review the archives > at http://archive.midrange.com/rpg400-l. >
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.