Socket SEND()
Nancy Palmquist
nlp at vss3.com
Fri Nov 7 11:13:14 PST 2008
Thank you all for the recv() advice. I was sending XML so I just collected data
until the final tag was received and all started working.
Now I notice that the send() side has similar issues, but I am not sure how to
test that the file was completely sent.
Programming goes like this:
status=send(accept_handle,ry{"")
if status ne instr(ry{"[**","[**","1")-"1" then I know I did not send the
correct number of bytes. I have error trapping for this. But it is not triggered.
status=socketclose(accept_handle)
BTW: using instr to figure out string length because dlen() causes CRASH on
fields longer than "4***" on this version.
I get a socket error -10054 at the recv() end of this which means the socket was
closed by the host before the data has completed its trip.
The value of status was correct, so I closed the socket. However, the data had
not flowed back fully. I added a SLEEP "1000" between the send() and the
socketclose() and it started working.
Is there a data related way to handle this? I am worried that the SLEEP "1000"
might not be long enough and it is wasting time if it is too long.
On the receive side, I could check the data to make sure it was all there. On
the send() side if the number of bytes sent is not real, how can I tell how long
to wait before closing the socket?
I really appreciate any help, even if it does not relate to the filepro sockets.
You were all very helpful last time.
Thanks,
Nancy
--
Nancy Palmquist MOS & filePro Training Available
Virtual Software Systems Web Based Training and Consulting
PHONE: (412) 835-9417 Web site: http://www.vss3.com
More information about the Filepro-list
mailing list