TCP Client - Buffer Logic
Posted: Tue Feb 09, 2010 11:42 pm
To Scott and anyone else with an interest:
I have written a TCP client plugin that allows for send and receive to an IP Address and Port. I plan on rolling this into a SageTV plugin that is used with the SageTCPServer, but wanted to put out a generic TCP client plug-in as well. So, the question is how to handle the data received? I am not a computer/network guru so I don't really have an understanding of how the buffer should work. With the SageTCPServer each data set is encapsulated between STX (0x02) and ETX (0x03). This means I can actually pick out each data set and present them one at a time via a property value. However, from my reading this seems to be somewhat non-standard for TCP communication. If I want to make a generic TCP client plug-in, how should the data be presented? Should it be based upon the size of the data (i.e., 128 characters have been received so present the data)? Should it just roll in as it's received, regardless of data length?
What are the criteria for presenting received data in the generic COM port plug-in? <To Scott>
How would others plan to use such a plug-in? What type of data would be received? Would you want the ability to toggle STX/ETX or Xon/Xoff as delimiters for the data received?
Osler
I have written a TCP client plugin that allows for send and receive to an IP Address and Port. I plan on rolling this into a SageTV plugin that is used with the SageTCPServer, but wanted to put out a generic TCP client plug-in as well. So, the question is how to handle the data received? I am not a computer/network guru so I don't really have an understanding of how the buffer should work. With the SageTCPServer each data set is encapsulated between STX (0x02) and ETX (0x03). This means I can actually pick out each data set and present them one at a time via a property value. However, from my reading this seems to be somewhat non-standard for TCP communication. If I want to make a generic TCP client plug-in, how should the data be presented? Should it be based upon the size of the data (i.e., 128 characters have been received so present the data)? Should it just roll in as it's received, regardless of data length?
What are the criteria for presenting received data in the generic COM port plug-in? <To Scott>
How would others plan to use such a plug-in? What type of data would be received? Would you want the ability to toggle STX/ETX or Xon/Xoff as delimiters for the data received?
Osler