After some while of googling I'm really confused. The answer is right in front of my eyes, but I still don't get it! It is said that:
The maximum packet size is 65535(including packet headers) ,but it actually isn't! It is the Maximum Transmission Unit(MTU) value!
From a programmer point-of-view, what is the value that I should take into consideration? If that value that I should consider is the MTU, what is the minimum MTU value that ever exists in this world?
One more thing. Since UDP uses datagrams to send packets over the network, having a maximum packet size makes sense. However, TCP transmits data as a stream of octets, so why is there a maximum packet size? (Just curious) Explained in comments below ✓
From a programmer point-of-view, what is the value that I should take into consideration? If that value that I should consider is the MTU, what is the minimum MTU value that ever exists in this world?
From a programmer point-of-view, you don't care what's going on under the hood. Just use TCP as a stream of bytes since that's what TCP provides to the application programmer. Do try not to make lots of small writes though, as that can cause inefficient network utilization and extra latency.