× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Thanks, I did not notice that. Probably the reason it's not working the way
I thought it was going to.

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Lim Hock-Chai
Sent: Wednesday, November 28, 2007 3:47 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: Send_File API versus Send API over a Socket

Looking at some doc on _C_IFS_fgets, it does not sound like a good api
to use when reading an image file. It seems to be intended for text
base file.


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Lim Hock-Chai
Sent: Wednesday, November 28, 2007 3:35 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: Send_File API versus Send API over a Socket

Also, you said you used unix's send api, I'm assuming that you are
referring to the socket send() api. This api has 4 parms and one of
them is the buffer/data length. How does your SendtheData() determines
the buffer length?

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Lim Hock-Chai
Sent: Wednesday, November 28, 2007 3:28 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: Send_File API versus Send API over a Socket

I do not know how those api work. However, it looks strange for me to
see %trim(BufOut) being used when attempt to use api to send the data.
Use of %trim would alter the data, which breaks the rule of sending the
data as it.

For example, if BufOut contains a string that happen to have leading
blanks, the %trim will strip them out before api sending it.



-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
sodonnell@xxxxxxxxxxxxxxxxxxxxxxxxx
Sent: Wednesday, November 28, 2007 2:28 PM
To: RPG400-L@xxxxxxxxxxxx
Subject: Re: Send_File API versus Send API over a Socket


Using FTP is not an option for this particular application.

Looking at the data a little closer in a tool that compares two
files...if I look at the data from a copy of the image file that I FTP
to the PC and compare it to the one sent over the socket, I can see
where there is a bunch of blank spaces inserted into my file, and it
looks like possibly a carriage return or line feed is being inserted
there too.

It has to be a buffer length issue or something like that.

Here's the relevant bit of code:

The variable bufOut is 32,767 bytes long (character field)

D ifsReadLine PR * ExtProc('_C_IFS_fgets')
D inBuffer * Value Options(*String)
D inBufLen 10i 0 Value
D inFilePtr * Value Options(*String)
*------------------------------------------------------------
C Dow ifsReadLine(%Addr(BufOut):
C %Size(BufOut):zp) <> *NULL
C callp(e) SendtheData(socketDescriptor:
%Trim(BufOut))
C Eval BufOut = *Blanks
C Enddo

--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.


--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.


--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
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 thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.