My code looks like below.
Problem is that sometimes( not everytime at least first execution was ok ) first data was not sent to the server.
But second data was successfully received by the server.
This means definitely first write command does not send anything.
How can this happen ?
Am I missing something about socket in Livecode ?
Code: Select all
-- set fetch size
put binaryEncode( "i", query_id ) into pkt_head
put binaryEncode( "i", PKT_ID_SET_FETCH_SIZE ) after pkt_head
put binaryEncode( "i", FETCH_SIZE ) after pkt_head
write pkt_head to socket opened_socket -- sometimes this data was not sent to the server
put "query_id = " & query_id && "fetch=" & FETCH_SIZE & return into fld "msg"
-- send query text
put binaryEncode( "i", query_id ) into pkt_head
put binaryEncode( "i", PKT_ID_COMMAND_TEXT ) after pkt_head
put binaryEncode( "i", the number of chars in command_text ) after pkt_head
write pkt_head to socket opened_socket