Re: Non blocking question
Posted: Wed Feb 27, 2019 9:05 pm
after a whole night of testing I just realized this is normal behavior
basically if the LC engine is doing other stuff it will lump all data together until it has time to call the handler again.
so I have to add a sort of flag to the beginning and end of the data strings so I can process it later
Anyways at least I understand what is non blocking now
as a side note, i ran a test that had an interesting result
I wrote a little piece of code that cycled 2000 times and transmitted a string of 100 characters
on the other machine i wrote some code to receive de data and put it on a field,
the code below get the data and put it in the field
on messagereceivedout pSocket, pMsg
global varMessageline
put pMsg into line varMessageline of field incomingt
put varMessageline + 1 into varMessageline
read from socket pSocket with message "messagereceivedout"
end messagereceivedout
the result was that on the field the 1st line was the 100 characters
and the second line was the remaining 199900
so that means that in the time that live code took to put the information on the field , all the
other data arrived and was put together in pMsg
if I add a "wait 50 millisecond" on the loop that sends the data then it gives plenty of time
to the machine that receives the data to populate the field line by line
the end result is the what I said at the top, I need to add a delimiter to the data streams so I can process
them later.
this is all great news actually, cause it means I don't have to fear data not being read
Tonight am gonna test transferring a big text file "the Bible" from multiple instances at the same time
and put them in text files on the receiving end and then comparing to see if all data is intact
am gonna host the receiving end on a virtual server on the other coast and see the reliability
but so far am very happy with live code and the things it can do
Happy live coding
basically if the LC engine is doing other stuff it will lump all data together until it has time to call the handler again.
so I have to add a sort of flag to the beginning and end of the data strings so I can process it later
Anyways at least I understand what is non blocking now
as a side note, i ran a test that had an interesting result
I wrote a little piece of code that cycled 2000 times and transmitted a string of 100 characters
on the other machine i wrote some code to receive de data and put it on a field,
the code below get the data and put it in the field
on messagereceivedout pSocket, pMsg
global varMessageline
put pMsg into line varMessageline of field incomingt
put varMessageline + 1 into varMessageline
read from socket pSocket with message "messagereceivedout"
end messagereceivedout
the result was that on the field the 1st line was the 100 characters
and the second line was the remaining 199900
so that means that in the time that live code took to put the information on the field , all the
other data arrived and was put together in pMsg
if I add a "wait 50 millisecond" on the loop that sends the data then it gives plenty of time
to the machine that receives the data to populate the field line by line
the end result is the what I said at the top, I need to add a delimiter to the data streams so I can process
them later.
this is all great news actually, cause it means I don't have to fear data not being read
Tonight am gonna test transferring a big text file "the Bible" from multiple instances at the same time
and put them in text files on the receiving end and then comparing to see if all data is intact
am gonna host the receiving end on a virtual server on the other coast and see the reliability
but so far am very happy with live code and the things it can do
Happy live coding