I am trying to read data coming from a TCP stream and then delimit the data and distribute it accordingly. The current method I am using is On Timer run netcat and command. While its doing a ridiculous list of other demands it will save the netcat output to a file. I then close netcat and ensure the file it is writing to is no longer in use. delimit and deliver.
While this method works sometimes but not too often, it wont connect to the IP fast enough to save the data to the file so the file comes up empty.
The solution I am looking for but cant seem to get to work is run something like LUASocket and have it stream. The first issue I found with LUASocket is if data doesn't load in its timely manor it will freeze until it sees data. The second issue I noticed is the ridiculous demands I have been calling for it to do are all on hold. The last issue I found is this is all good in theory but on demand will not connect to the host IP.
A second thought I had is run netcat with out closing it and every now and again reach in and pick out a line from the file its being saved to. AMS doesn't seem to like to open files in use and for some reason I cant get io.open to work.
Any help or other options would be greatly appreciated.
While this method works sometimes but not too often, it wont connect to the IP fast enough to save the data to the file so the file comes up empty.
The solution I am looking for but cant seem to get to work is run something like LUASocket and have it stream. The first issue I found with LUASocket is if data doesn't load in its timely manor it will freeze until it sees data. The second issue I noticed is the ridiculous demands I have been calling for it to do are all on hold. The last issue I found is this is all good in theory but on demand will not connect to the host IP.
A second thought I had is run netcat with out closing it and every now and again reach in and pick out a line from the file its being saved to. AMS doesn't seem to like to open files in use and for some reason I cant get io.open to work.
Any help or other options would be greatly appreciated.
Comment