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



Fun with HL7 I see. When you need to test for certain strings that you
receive over a socket connection, you should always have two buffers and
never check the one that gets the bytes from the socket. Read from the
socket and then append the number of bytes read to a holding buffer.
Check the holding buffer for the end message you are looking for. If
you don't find you string, loop back and read some more bytes and then
append them to the holding buffer and check again. You will have to
keep track of where you are in the holding buffer as you move data in
and out of it, but that is only real way to deal with streaming data.


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of GKern@xxxxxxxxxxxxxxxx
Sent: Friday, November 02, 2007 2:48 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: SETSOCKOPT question

Hi Scott,

"I'm really curious as to why you'd want to mess with this setting."

I was curious if this was an alternative (to enable increasing the
size of
the data stream received in one read of the buffer) since I'm having a
problem with my socket server program where ~I think~ the end of data
stream I'm scanning for (x'1c0d' may be found in two subsequent reads
of
the buffer (where one read of the buffer has the x'1c' and the next
read
starts with the x'0d' which should be (logically) attached to the last
byte of the last buffer read).

I'm having a problem where when I receive data it appears that I'm
receiving beginning of data characters (x'0b') before I receive the
end of
data characters (x'1c0d'). This has only happened 12 times out of over
3300 files I've received by the socket server last month.

But then I concluded that if the end of data characters being split
between two reads of the buffer really is the problem, then a larger
data
stream wouldn't really solve my problem. (So I abandoned the idea of
trying to enlarge the maximum segment size.)

I've since changed my socket program to hopefully correct it by
scanning
for the x'1c' (in addition to scanning for the full x'1c0d') and
making an
assumption that when it (x'1c') is found that I can proceed as if it
is
the end of the data. It's being tested right now. And as far as I know
I
should never be receiving x'1c' except to signal 'message completion'
within the data stream received.

Thanks for responding.

Regards, Jerry

Gerald Kern - MIS Project Leader
Lotus Notes/Domino Administrator
IBM Certified RPG IV Developer
The Toledo Clinic, Inc.
4235 Secor Road
Toledo, OH 43623-4299
Phone 419-479-5535
gkern@xxxxxxxxxxxxxxxx


This e-mail message, including any attachments, is for the sole use of
the
intended recipient(s) and may contain confidential and privileged
information. Any unauthorized use, disclosure or distribution is
prohibited. If you are not the intended recipient, please inform the
sender by reply e-mail and destroy this and all copies of this
message.
--
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.