Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 3
    TCP data flow is not packet oriented, rather that is detail hidden in the implementation itself; a properly implemented TCP server must accept data arriving in any combination of packets, including one character per packet, words or lines broken between packets, packets that contain the end of one thing and the start of another, etc. Commented Jul 6, 2017 at 3:54
  • You can try sending all characters in a single print() but you're basically trying to use undocumented behavior of one thing to accommodate erroneous behavior of another. Commented Jul 6, 2017 at 3:55
  • Sounds like the problem is on the receiving end. Try shift/or-ing all values into one unsigned long and send that with one call to print. Commented Jul 6, 2017 at 17:38
  • Use UDP if you want to send a data that fit in a single packet. TCP is costly due to the overhead of open/close a sesion. Commented Feb 9, 2018 at 15:00