Server sending data at a sampling rate 100 Hz and the client receiving and processing time is around 0.1s using Python
From the comment section:

The server is a software from where I am receiving the samples. And the manual of the software says the sampling rate of the samples is 100Hz. My client code receives it and checks if the data within the sample is above the threshold value or not and displays an error on the screen when it is. To be able to check for every sample that is being streamed by the software, my receiving and computation must be faster. Could you explain how could I use buffer to better my case? I am sorry if my question is very silly. But this is my first attempt in TCP programming as well as Python

For a sampling rate of 100 Hz the network latency has to be below 10ms.
First test: Determine the network latency...
Only receive the data and log the times (including milliseconds) to a file. If you have gaps of more than 10ms between the datapackets, the network is probably not fast enough.
If the gaps are far below the 10ms, data processing is too slow.
Server-side buffering (high latency):
If you can change the server, consider sending multiple packets at once, but at a slower frequency. The client would have more time to process the data instead of waiting for the I/O.
Client-side buffering (low latency):
If the server sends packets faster than you can process them, consider a FIFO buffer for the client. Incoming data is appended to the buffer, while processing code fetches its packets from the queue, ideally simultaneously.
Lastly, some warm words of warning: You [say you] are new to a programming language and network programming - it's probably too early for a realtime data processing project and I would suggest to start with a simpler projects for training purposes...
I have a server which continuously sends data block (sample) at a sampling rate of 100Hz. My client receives it and performs some calculation on the sample to visually display a real-time tracking and then receives the next sample and so on. The time taken for it to receive and calculate until the next sample is received is 0.1s.
This means that I am missing on the in between samples, if I am not wrong. How can change the code such that I receive 'all samples' and perform the calculation in order to enable a real-time tracking?
Thank you in advance!