× 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.



Could you be banging up against size constraints?

Mark Walter
Paragon Consulting Services, Inc.
IBM Certified System i Specialist
717-764-7909 Ext. 26
mwalter@xxxxxxxxxxxxxxx
www.paragon-csi.com



"sodonnell@xxxxxxxxxxxxxxxxxxxxxxxxx"
<sodonnell@xxxxxxxxxxxxxxxxxxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
11/28/2007 03:01 PM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>


To
rpg400-l@xxxxxxxxxxxx
cc

Subject
Send_File API versus Send API over a Socket






Hello,

I have an application that reads an image file off of the IFS (it's a TIFF
file if that makes a difference...) and then I send it to a PC over a
socket.

I'm using the _C_IFS_OPEN and _C_IFS_GETS to read the file and I'm using
the Unix-type API Send to send the file across the socket.

The problem I'm having is that somewhere along the way, my image file is
getting corrupted. That is, the first few lines of the image data are
fine,
and in fact, you can even make out a little bit of what the image is if
you look at it in Windows. But somewhere between the last point where I
have
good data and the end of the file (or possibly including the end of the
file too), my image data gets altered.

If I look at the file in Notepad or Wordpad or even in a DOS prompt, I can
see that the data is MOSTLY correct. however, there are places where the
data is obviously different. And since it's in hex (or whatever...) it's
impossible for me to look at it and say, "Oh, there's a line feed or
carriage
return there where there shouldn't be."

So, what I'm wondering is... If I used the Send_File API (instead of SEND
and the _OPEN and _GETS APIs (as shown above)), do you think my chances of

avoiding trashed data would improve? I guess I could just try it and see
but I was hoping someone might have used Send_File before and had some
experience with it.

There are 3 distinct points where the data could be getting hosed in this
process:

1. When I read the data using the _C_IFS_GETS API.
2. When the data is sent across the socket from my RPGLE program.
3. When the data is received at the socket server.

The last one does not seem as likely simply because that process has
worked flawlessly for years. On the other hand, I don't know if I've ever
send
an image file like this before to it. This might be a first for me as it's
been awhile since I messed with any of this, I don't really remember.

It seems more likely to me that the problem is either in the Read or the
file from the IFS or it's in the send across the socket.

Thoughts, opinions suggestions and anything else is welcome.

thanks,

Shannon O'Donnell


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.