I'm developing a simple application that will receive data from a hardware via TCP. I've searched a bit on the Internet how to develop a program to receive TCP data, but have not found anything that I'm happy with. It is either a very simplified descriptions of how to work with TCP in C # or it is description of advanced frameworks.
I want a simple best practice of how to organize the communication part of my program in a good object-oriented manner. Any suggestions?
Ideally, I want the different structures that are sent via TCP are stored in the corresponding struct in the program
structure of what is sent:
Head
{
  Int16    Mode;
  Time     Start_time //(Unix time)
  Int16    Number of records
}
for each record if mode == 1
  char[20]    Name_of_record
for each record
  float    Value_of_record //(hardware-specific float)
  Int16    Flag_of_record
Foot
{
  Time     Stop_time //(Unix time)
}
And this is sent once a minute. There is no overhead. It just sends out the value of all variables and no more
Edit I do not have any control over the server.
 
     
    