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



On Mon, 2004-01-26 at 14:20, GKern@xxxxxxxxxxxxxxxx wrote:
> Here is the exact code - note the first statement sets SocketData  to 
> *Blanks - which to me, should clear the buffer. Please correct me if I'm 
> wrong?
> 
>  * Load socket field and determine number of bytes in field... 
> C                   Eval      SocketData = *Blanks 
> C                   Eval      SocketData = HL7 
>  
> C                   Eval      SocketData = %Trim(SocketData) + End_Block 
> C                   Eval      SocketData = %Trim(SocketData) + Car_Return 
> C                   Eval      SockDtaLen = %Len(SocketData) 
>  
>  * Loop until message is accepted... 
> C                   Eval      Tries = *Zero 
> C                   Eval      Ack = No 
> C                   Dou       Ack = Yes or Tries = 3 
>  * Send the segment to the server over the socket... 
>  * (NOTE - Need to add 2 to SockDtaLen since SocketData is defined as 
>  *  VARYING - which adds 2 extra bytes to the field since the first 
>  *  two bytes contain a binary value that identifies the actual length 
>  *  of the data in the variable length field...) 
> C                   Eval      RC = 
> Write(SD:%Addr(SocketData):SockDtaLen+2)

Here is part of the problem.  You send the address of a varying length
field, which includes the length in the first two bytes.  Perhaps try

Write(SD:%Addr(SocketData)+2:SockDtaLen)

Don't forget to loop in case where rc is greater than 0, but not equal
to SockDtaLen.


Regards,
Rich


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.